Changeset 1822
- Timestamp:
- Nov 20, 2017, 3:19:07 PM (7 years ago)
- Location:
- trunk/LMDZ.TITAN/libf/phytitan
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90
r1788 r1822 6 6 fluxabs_sw,fluxtop_dn, & 7 7 OLR_nu,OSR_nu, & 8 firstcall,lastcall)8 lastcall) 9 9 10 10 use mod_phys_lmdz_para, only : is_master 11 11 use radinc_h 12 12 use radcommon_h 13 use datafile_mod, only: datadir14 use ioipsl_getin_p_mod, only: getin_p15 13 use gases_h 16 14 USE tracer_h 15 use callkeys_mod, only: global1d, szangle 17 16 use comcstfi_mod, only: pi, mugaz, cpp 18 17 use callkeys_mod, only: diurnal,tracer, & … … 58 57 REAL,INTENT(IN) :: fract(ngrid) ! Fraction of day. 59 58 REAL,INTENT(IN) :: dist_star ! Distance star-planet (AU). 60 logical,intent(in) :: firstcall ! Signals first call to physics.61 59 logical,intent(in) :: lastcall ! Signals last call to physics. 62 60 … … 107 105 INTEGER ig,l,k,nw 108 106 109 real szangle110 logical global1d111 save szangle,global1d112 !$OMP THREADPRIVATE(szangle,global1d)113 107 real*8 taugsurf(L_NSPECTV,L_NGAUSS-1) 114 108 real*8 taugsurfi(L_NSPECTI,L_NGAUSS-1) 115 116 117 ! Miscellaneous :118 character(len=10) :: tmp1119 character(len=10) :: tmp2120 109 121 110 logical OLRz … … 127 116 128 117 129 !=============================================================== 130 ! I.a Initialization on first call 131 !=============================================================== 132 133 134 if(firstcall) then 135 136 call system('rm -f surf_vals_long.out') 137 138 !-------------------------------------------------- 139 ! Set up correlated k 140 !-------------------------------------------------- 141 142 143 print*, "callcorrk: Correlated-k data base folder:",trim(datadir) 144 call getin_p("corrkdir",corrkdir) 145 print*, "corrkdir = ",corrkdir 146 write( tmp1, '(i3)' ) L_NSPECTI 147 write( tmp2, '(i3)' ) L_NSPECTV 148 banddir=trim(adjustl(tmp1))//'x'//trim(adjustl(tmp2)) 149 banddir=trim(adjustl(corrkdir))//'/'//trim(adjustl(banddir)) 150 151 call setspi ! Basic infrared properties. 152 call setspv ! Basic visible properties. 153 call sugas_corrk ! Set up gaseous absorption properties. 154 155 OLR_nu(:,:) = 0. 156 OSR_nu(:,:) = 0. 157 158 if (ngrid.eq.1) then 159 PRINT*, 'Simulate global averaged conditions ?' 160 global1d = .false. ! default value 161 call getin_p("global1d",global1d) 162 write(*,*) "global1d = ",global1d 163 164 ! Test of incompatibility : if global1d is true, there should not be any diurnal cycle. 165 if (global1d.and.diurnal) then 166 print*,'if global1d is true, diurnal must be set to false' 167 stop 168 endif 169 170 if (global1d) then 171 PRINT *,'Solar Zenith angle (deg.) ?' 172 PRINT *,'(assumed for averaged solar flux S/4)' 173 szangle=60.0 ! default value 174 call getin_p("szangle",szangle) 175 write(*,*) "szangle = ",szangle 176 endif 177 endif 178 179 end if ! of if (firstcall) 180 181 !======================================================================= 182 ! I.b Initialization on every call 118 !======================================================================= 119 ! I. Initialization on every call 183 120 !======================================================================= 184 121 … … 361 298 endif 362 299 363 call optcv( dtauv,tauv,taucumv,plevrad,&364 wbarv,cosbv,tauray,tmid,pmid,taugsurf)300 call optcv(pq,plevrad,tmid,pmid, & 301 dtauv,tauv,taucumv,wbarv,cosbv,tauray,taugsurf) 365 302 366 303 call sfluxv(dtauv,tauv,taucumv,albv,dwnv,wbarv,cosbv, & … … 403 340 !----------------------------------------------------------------------- 404 341 405 call optci(p levrad,tlevrad,dtaui,taucumi,&406 cosbi,wbari,tmid,pmid,taugsurfi)342 call optci(pq,plevrad,tlevrad,tmid,pmid, & 343 dtaui,taucumi,cosbi,wbari,taugsurfi) 407 344 408 345 call sfluxi(plevrad,tlevrad,dtaui,taucumi,ubari,albi, & -
trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
r1795 r1822 14 14 logical,save :: strictboundcorrk 15 15 !$OMP THREADPRIVATE(strictboundcorrk) 16 17 16 logical,save :: callchim, callmufi, callclouds 18 17 !$OMP THREADPRIVATE(callchim,callmufi,callclouds) 19 18 logical,save :: global1d 19 !$OMP THREADPRIVATE(global1d) 20 20 logical,save :: enertest 21 21 logical,save :: nonideal … … 40 40 integer,save :: ichim 41 41 !$OMP THREADPRIVATE(ichim) 42 43 42 integer,save :: iddist 44 43 integer,save :: iradia … … 51 50 !$OMP THREADPRIVATE(df_mufi, rm_mufi, rho_aer_mufi,p_prod,tx_prod,rc_prod,air_rad) 52 51 52 real,save :: szangle 53 !$OMP THREADPRIVATE(szangle) 53 54 real,save :: Fat1AU 54 55 real,save :: stelTbb -
trunk/LMDZ.TITAN/libf/phytitan/datafile_mod.F90
r1795 r1822 14 14 character(len=12),parameter :: surfdir="surface_data" 15 15 16 ! Default directories for correlated-k data 17 ! Set in inifis_mod 18 character(LEN=100),save :: corrkdir = 'datagcm/corrk_data/50X50' 19 character(LEN=100),save :: banddir = 'datagcm/corrk_data/50X50/50x50' 20 !$OMP THREADPRIVATE(corrkdir,banddir) 21 16 22 ! Default directory for microphysics 17 character(LEN=300),save :: config_mufi ='datagcm/microphysics/config.cfg' 23 ! Set in inifis_mod 24 character(LEN=100),save :: config_mufi ='datagcm/microphysics/config.cfg' 25 !$OMP THREADPRIVATE(config_mufi) 18 26 19 27 end module datafile_mod -
trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
r1795 r1822 10 10 11 11 use radinc_h, only: ini_radinc_h 12 use datafile_mod , only: datadir,config_mufi12 use datafile_mod 13 13 use comdiurn_h, only: sinlat, coslat, sinlon, coslon 14 14 use comgeomfi_h, only: totarea, totarea_planet … … 220 220 call getin_p("corrk",corrk) 221 221 write(*,*) " corrk = ",corrk 222 223 if (corrk) then 224 ! default path is set in datadir 225 write(*,*) "callcorrk: Correlated-k data base folder:",trim(datadir) 226 call getin_p("corrkdir",corrkdir) 227 write(*,*) " corrkdir = ",corrkdir 228 endif 229 230 if (corrk .and. ngrid.eq.1) then 231 write(*,*) "simulate global averaged conditions ?" 232 global1d = .false. ! default value 233 call getin_p("global1d",global1d) 234 write(*,*) " global1d = ",global1d 235 236 ! Test of incompatibility : if global1d is true, there should not be any diurnal cycle. 237 if (global1d.and.diurnal) then 238 write(*,*) "if global1d is true, diurnal must be set to false" 239 stop 240 endif 241 242 if (global1d) then 243 write(*,*) "Solar Zenith angle (deg.) ?" 244 write(*,*) "(assumed for averaged solar flux S/4)" 245 szangle=60.0 ! default value 246 call getin_p("szangle",szangle) 247 write(*,*) " szangle = ",szangle 248 endif 249 endif 222 250 223 251 write(*,*) "prohibit calculations outside corrk T grid?" … … 349 377 df_mufi=2.0 ! default value 350 378 call getin_p("df_mufi",df_mufi) 379 write(*,*)" df_mufi = ",df_mufi 351 380 352 381 write(*,*) "Monomer radius (m) ?" 353 382 rm_mufi=6.66e-08 ! default value 354 383 call getin_p("rm_mufi",rm_mufi) 384 write(*,*)" rm_mufi = ",rm_mufi 355 385 356 386 write(*,*) "Aerosol density (kg.m-3)?" 357 387 rho_aer_mufi=1.e3 ! default value 358 388 call getin_p("rho_aer_mufi",rho_aer_mufi) 389 write(*,*)" rho_aer_mufi = ",rho_aer_mufi 359 390 360 391 write(*,*) "Pressure level of aer. production (Pa) ?" 361 392 p_prod=1.0 ! default value 362 393 call getin_p("p_prod",p_prod) 394 write(*,*)" p_prod = ",p_prod 363 395 364 396 write(*,*) "Aerosol production rate (kg.m-2.s-1) ?" 365 397 tx_prod=3.5e-13 ! default value 366 398 call getin_p("tx_prod",tx_prod) 399 write(*,*)" tx_prod = ",tx_prod 367 400 368 401 write(*,*) "Equivalent radius production (m) ?" 369 402 rc_prod=2.0e-8 ! default value 370 403 call getin_p("rc_prod",rc_prod) 404 write(*,*)" rhc_prod = ",rc_prod 371 405 372 406 write(*,*) "Radius of air (nitrogen) molecule (m) ?" 373 407 air_rad=1.75e-10 ! default value 374 408 call getin_p("air_rad",air_rad) 409 write(*,*)" air_rad = ",air_rad 375 410 376 411 write(*,*) "Path to microphys. config file ?" 377 412 config_mufi='datagcm/microphysics/config.cfg' ! default value 378 413 call getin_p("config_mufi",config_mufi) 414 write(*,*)" config_mufi = ",config_mufi 379 415 380 416 ! Soil model -
trunk/LMDZ.TITAN/libf/phytitan/optci.F90
r1792 r1822 1 subroutine optci(P LEV,TLEV,DTAUI,TAUCUMI, &2 COSBI,WBARI,TMID,PMID,TAUGSURF)1 subroutine optci(PQ,PLEV,TLEV,TMID,PMID, & 2 DTAUI,TAUCUMI,COSBI,WBARI,TAUGSURF) 3 3 4 4 use radinc_h … … 17 17 ! and COSBAR. For each level it calculates TAU. 18 18 ! 19 ! TAU I(L,LW) is the cumulative optical depth at level L (or alternatively19 ! TAUCUMI(L,LW) is the cumulative optical depth at level L (or alternatively 20 20 ! at the *bottom* of layer L), LW is the spectral wavelength interval. 21 21 ! … … 26 26 ! ------- 27 27 ! Adapted from the NASA Ames code by R. Wordsworth (2009) 28 ! Clean and adaptation to Titan by J. Vatant d'Ollone (2016-17) 28 29 ! 29 30 !================================================================== 30 31 31 32 32 real*8 DTAUI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 33 !========================================================== 34 ! Input/Output 35 !========================================================== 36 REAL*8, INTENT(IN) :: PQ ! Tracers (kg/kg_of_air). 37 REAL*8, INTENT(IN) :: PLEV(L_LEVELS), TLEV(L_LEVELS) 38 REAL*8, INTENT(IN) :: TMID(L_LEVELS), PMID(L_LEVELS) 39 40 REAL*8, INTENT(OUT) :: DTAUI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 41 REAL*8, INTENT(OUT) :: TAUCUMI(L_LEVELS,L_NSPECTI,L_NGAUSS) 42 REAL*8, INTENT(OUT) :: COSBI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 43 REAL*8, INTENT(OUT) :: WBARI(L_NLAYRAD,L_NSPECTI,L_NGAUSS) 44 REAL*8, INTENT(OUT) :: TAUGSURF(L_NSPECTI,L_NGAUSS-1) 45 ! ========================================================== 46 33 47 real*8 DTAUKI(L_LEVELS,L_NSPECTI,L_NGAUSS) 34 real*8 TAUI(L_NLEVRAD,L_NSPECTI,L_NGAUSS)35 real*8 TAUCUMI(L_LEVELS,L_NSPECTI,L_NGAUSS)36 real*8 PLEV(L_LEVELS)37 real*8 TLEV(L_LEVELS)38 real*8 TMID(L_LEVELS), PMID(L_LEVELS)39 real*8 COSBI(L_NLAYRAD,L_NSPECTI,L_NGAUSS)40 real*8 WBARI(L_NLAYRAD,L_NSPECTI,L_NGAUSS)41 48 42 49 ! Titan customisation … … 58 65 real*8 LCOEF(4), LKCOEF(L_LEVELS,4) 59 66 60 real*8 taugsurf(L_NSPECTI,L_NGAUSS-1)61 67 real*8 DCONT 62 68 double precision wn_cont, p_cont, p_air, T_cont, dtemp, dtempc -
trunk/LMDZ.TITAN/libf/phytitan/optcv.F90
r1792 r1822 1 SUBROUTINE OPTCV( DTAUV,TAUV,TAUCUMV,PLEV, &2 WBARV,COSBV,TAURAY,TMID,PMID,TAUGSURF)1 SUBROUTINE OPTCV(PQ,PLEV,TMID,PMID, & 2 DTAUV,TAUV,TAUCUMV,WBARV,COSBV,TAURAY,TAUGSURF) 3 3 4 4 use radinc_h … … 19 19 ! ------- 20 20 ! Adapted from the NASA Ames code by R. Wordsworth (2009) 21 ! Clean and adaptation to Titan by J. Vatant d'Ollone (2016-17) 21 22 ! 22 23 !================================================================== … … 37 38 38 39 39 real*8 DTAUV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 40 !========================================================== 41 ! Input/Output 42 !========================================================== 43 REAL*8, INTENT(IN) :: PQ ! Tracers (kg/kg_of_air). 44 REAL*8, INTENT(IN) :: PLEV(L_LEVELS) 45 REAL*8, INTENT(IN) :: TMID(L_LEVELS), PMID(L_LEVELS) 46 47 REAL*8, INTENT(OUT) :: DTAUV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 48 REAL*8, INTENT(OUT) :: TAUV(L_NLEVRAD,L_NSPECTV,L_NGAUSS) 49 REAL*8, INTENT(OUT) :: TAUCUMV(L_LEVELS,L_NSPECTV,L_NGAUSS) 50 REAL*8, INTENT(OUT) :: COSBV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 51 REAL*8, INTENT(OUT) :: WBARV(L_NLAYRAD,L_NSPECTV,L_NGAUSS) 52 ! ========================================================== 53 40 54 real*8 DTAUKV(L_LEVELS,L_NSPECTV,L_NGAUSS) 41 real*8 TAUV(L_NLEVRAD,L_NSPECTV,L_NGAUSS)42 real*8 TAUCUMV(L_LEVELS,L_NSPECTV,L_NGAUSS)43 real*8 PLEV(L_LEVELS)44 real*8 TMID(L_LEVELS), PMID(L_LEVELS)45 real*8 COSBV(L_NLAYRAD,L_NSPECTV,L_NGAUSS)46 real*8 WBARV(L_NLAYRAD,L_NSPECTV,L_NGAUSS)47 55 48 56 ! Titan customisation -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r1812 r1822 20 20 use comsaison_h, only: mu0, fract, dist_star, declin, right_ascen 21 21 use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat 22 use datafile_mod, only: datadir, corrkdir, banddir 22 23 use geometry_mod, only: latitude, longitude, cell_area 23 24 USE comgeomfi_h, only: totarea, totarea_planet … … 37 38 use callkeys_mod 38 39 use vertical_layers_mod, only: presnivs, pseudoalt 40 use ioipsl_getin_p_mod, only: getin_p 39 41 #ifdef CPP_XIOS 40 42 use xios_output_mod, only: initialize_xios_output, & … … 308 310 309 311 312 310 313 ! local variables for DIAGNOSTICS : (diagfi & stat) 311 314 ! ------------------------------------------------- … … 349 352 real,allocatable,dimension(:,:),save :: qsurf_hist 350 353 !$OMP THREADPRIVATE(qsurf_hist) 354 355 ! Miscellaneous : 356 character(len=10) :: tmp1 357 character(len=10) :: tmp2 351 358 352 359 ! Local variables for Titan chemistry and microphysics (JVO 2017) … … 458 465 zdtlw(:,:) = 0.0 459 466 467 ! Initialize setup for correlated-k radiative transfer 468 ! JVO 17 : Was in callcorrk firstcall, but we need spectral intervals for microphysics 469 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 470 471 if (corrk) then 472 473 call system('rm -f surf_vals_long.out') 474 475 write( tmp1, '(i3)' ) L_NSPECTI 476 write( tmp2, '(i3)' ) L_NSPECTV 477 banddir=trim(adjustl(tmp1))//'x'//trim(adjustl(tmp2)) 478 banddir=trim(adjustl(corrkdir))//'/'//trim(adjustl(banddir)) 479 480 call setspi ! Basic infrared properties. 481 call setspv ! Basic visible properties. 482 call sugas_corrk ! Set up gaseous absorption properties. 483 484 OLR_nu(:,:) = 0. 485 OSR_nu(:,:) = 0. 486 487 endif 488 460 489 ! Initialize names, timestep and saturation profiles for chemistry 461 490 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 517 546 stop 518 547 endif 519 520 548 write (*,*) 'In physiq day_ini =', day_ini 521 549 … … 792 820 fluxsurfabs_sw,fluxtop_lw, & 793 821 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu, & 794 firstcall,lastcall)822 lastcall) 795 823 796 824 ! Radiative flux from the sky absorbed by the surface (W.m-2). -
trunk/LMDZ.TITAN/libf/phytitan/radinc_h.F90
r1788 r1822 79 79 !real*8,parameter :: NTfac = 1.0D+2 80 80 81 character(len=100),save :: corrkdir82 !$OMP THREADPRIVATE(corrkdir)83 84 character(len=100),save :: banddir85 !$OMP THREADPRIVATE(banddir)86 87 81 contains 88 82 -
trunk/LMDZ.TITAN/libf/phytitan/setspi.F90
r1788 r1822 22 22 !================================================================== 23 23 24 use radinc_h, only: L_NSPECTI, corrkdir,banddir,NTstar,NTstop,NTfac24 use radinc_h, only: L_NSPECTI,NTstar,NTstop,NTfac 25 25 use radcommon_h, only: BWNI,WNOI,DWNI,WAVEI,planckir,sigma 26 use datafile_mod, only: datadir 26 use datafile_mod, only: datadir, corrkdir, banddir 27 27 use comcstfi_mod, only: pi 28 28 -
trunk/LMDZ.TITAN/libf/phytitan/setspv.F90
r1788 r1822 23 23 !================================================================== 24 24 25 use radinc_h, only: L_NSPECTV , corrkdir, banddir25 use radinc_h, only: L_NSPECTV 26 26 use radcommon_h, only: BWNV,WNOV,DWNV,WAVEV, & 27 27 STELLARF,TAURAY 28 use datafile_mod, only: datadir 28 use datafile_mod, only: datadir, corrkdir, banddir 29 29 use callkeys_mod, only: Fat1AU,rayleigh 30 30 -
trunk/LMDZ.TITAN/libf/phytitan/sugas_corrk.F90
r1648 r1822 25 25 use radcommon_h, only : gasv,gasi,FZEROI,FZEROV,gweight 26 26 use radcommon_h, only : WNOI,WNOV 27 use datafile_mod, only: datadir 27 use datafile_mod, only: datadir, corrkdir, banddir 28 28 use comcstfi_mod, only: mugaz 29 29 use gases_h
Note: See TracChangeset
for help on using the changeset viewer.