Changeset 2366 for trunk/LMDZ.TITAN/libf/phytitan
- Timestamp:
- Jun 11, 2020, 7:40:22 PM (5 years ago)
- Location:
- trunk/LMDZ.TITAN/libf/phytitan
- Files:
-
- 1 added
- 1 deleted
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/phytitan/callcorrk.F90
r2138 r2366 17 17 use comcstfi_mod, only: pi, mugaz, cpp 18 18 use callkeys_mod, only: diurnal,tracer,seashaze,corrk_recombin, & 19 strictboundcorrk,specOLR,diagdtau 19 strictboundcorrk,specOLR,diagdtau, & 20 tplanckmin,tplanckmax 20 21 use geometry_mod, only: latitude 21 22 … … 115 116 real*8 taugsurf(L_NSPECTV,L_NGAUSS-1) 116 117 real*8 taugsurfi(L_NSPECTI,L_NGAUSS-1) 118 119 ! Miscellaneous : 120 character(len=100) :: message 121 character(len=10),parameter :: subname="callcorrk" 117 122 118 123 logical OLRz … … 377 382 endif 378 383 endif 384 385 if (tlevrad(k).lt.tplanckmin) then 386 print*,'Minimum temperature is outside the boundaries for' 387 print*,'Planck function integration set in callphys.def, aborting.' 388 print*,"k=",k," tlevrad(k)=",tlevrad(k) 389 print*,"tplanckmin=",tplanckmin 390 message="Minimum temperature outside Planck function bounds - Change tplanckmin in callphys.def" 391 call abort_physic(subname,message,1) 392 else if (tlevrad(k).gt.tplanckmax) then 393 print*,'Maximum temperature is outside the boundaries for' 394 print*,'Planck function integration set in callphys.def, aborting.' 395 print*,"k=",k," tlevrad(k)=",tlevrad(k) 396 print*,"tplanckmax=",tplanckmax 397 message="Maximum temperature outside Planck function bounds - Change tplanckmax in callphys.def" 398 call abort_physic(subname,message,1) 399 endif 400 379 401 enddo 402 380 403 do k=1,L_NLAYRAD+1 381 404 if(tmid(k).lt.tgasmin)then -
trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
r2245 r2366 60 60 real,save :: szangle 61 61 !$OMP THREADPRIVATE(szangle) 62 63 real,save :: tplanckmin 64 real,save :: tplanckmax 65 real,save :: dtplanck 66 !$OMP THREADPRIVATE(tplanckmin,tplanckmax,dtplanck) 62 67 real,save :: Fat1AU 63 68 real,save :: stelTbb … … 76 81 real,save :: surfemis 77 82 !$OMP THREADPRIVATE(surfalbedo,surfemis) 78 83 real,save :: noseason_day 84 !$OMP THREADPRIVATE(noseason_day) 79 85 logical,save :: iscallphys=.false.!existence of callphys.def 80 86 !$OMP THREADPRIVATE(iscallphys) -
trunk/LMDZ.TITAN/libf/phytitan/comsaison_h.F90
r1327 r2366 4 4 implicit none 5 5 6 integer isaison 7 logical callsais 8 real dist_star,declin,right_ascen 6 ! integer,save :: isaison 7 ! logical,save :: callsais 8 !!$OMP THREADPRIVATE(isaison,callsais) 9 10 real,save :: dist_star,declin,right_ascen 11 !$OMP THREADPRIVATE(dist_star,declin,right_ascen) 9 12 10 13 real, allocatable, dimension(:) :: mu0,fract 11 !$OMP THREADPRIVATE( isaison,callsais,dist_star,declin,mu0,fract)14 !$OMP THREADPRIVATE(mu0,fract) 12 15 13 16 end module comsaison_h -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/abort_gcm.F
r1403 r2366 1 link ../../ dyn3d/abort_gcm.F1 link ../../../../LMDZ.COMMON/libf/dyn3d/abort_gcm.F -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/comconst_mod.F90
r1422 r2366 1 link ../../ dyn3d/comconst_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/comconst_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/comgeom.h
r1403 r2366 1 link ../../ dyn3d/comgeom.h1 link ../../../../LMDZ.COMMON/libf/dyn3d_common/comgeom.h -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/comvert_mod.F90
r1422 r2366 1 link ../../ dyn3d/comvert_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/comvert_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/control_mod.F90
r1403 r2366 1 link ../../ dyn3d/control_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/control_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/ener_mod.F90
r1422 r2366 1 link ../../ dyn3d/ener_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/ener_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/infotrac.F90
r1403 r2366 1 link ../../ dyn3d/infotrac.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/infotrac.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/logic_mod.F90
r1422 r2366 1 link ../../ dyn3d/logic_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d/logic_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/mod_const_mpi.F90
r1403 r2366 1 link ../../ dyn3d/mod_const_mpi.F901 link ../../../../LMDZ.COMMON/libf/dyn3d/mod_const_mpi.F90 -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/paramet.h
r1403 r2366 1 link ../../ dyn3d/paramet.h1 link ../../../../LMDZ.COMMON/libf/dyn3d_common/paramet.h -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/rcm1d.F
r2116 r2366 28 28 & presnivs,pseudoalt,scaleheight 29 29 USE vertical_layers_mod, ONLY: init_vertical_layers 30 USE logic_mod, ONLY: hybrid ,autozlevs30 USE logic_mod, ONLY: hybrid 31 31 use regular_lonlat_mod, only: init_regular_lonlat 32 32 use planete_mod, only: ini_planete_mod … … 35 35 use mod_interface_dyn_phys, only: init_interface_dyn_phys 36 36 use inifis_mod, only: inifis 37 use phys_state_var_mod, only: phys_state_var_init 37 38 use physiq_mod, only: physiq 38 39 implicit none … … 118 119 119 120 ! added by RW for autozlevs computation 121 logical autozlevs 120 122 real nu, xx, pMIN, zlev, Htop 121 123 real logplevs(llm) … … 132 134 c INITIALISATION 133 135 c======================================================================= 134 ! initialize "serial/parallel" related stuff 135 ! CALL init_phys_lmdz(iim,jjm+1,llm,1,(/(jjm-1)*iim+2/)) 136 ! CALL init_phys_lmdz(1,1,llm,1,(/1/)) 137 ! call initcomgeomphy 138 139 !! those are defined in surfdat_h.F90 140 IF (.not. ALLOCATED(albedodat)) ALLOCATE(albedodat(1)) 141 IF (.not. ALLOCATED(phisfi)) ALLOCATE(phisfi(1)) 142 IF (.not. ALLOCATED(zmea)) ALLOCATE(zmea(1)) 143 IF (.not. ALLOCATED(zstd)) ALLOCATE(zstd(1)) 144 IF (.not. ALLOCATED(zsig)) ALLOCATE(zsig(1)) 145 IF (.not. ALLOCATED(zgam)) ALLOCATE(zgam(1)) 146 IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(1)) 147 !! those are defined in comdiurn_h.F90 148 IF (.not.ALLOCATED(sinlat)) ALLOCATE(sinlat(1)) 149 IF (.not.ALLOCATED(coslat)) ALLOCATE(coslat(1)) 150 IF (.not.ALLOCATED(sinlon)) ALLOCATE(sinlon(1)) 151 IF (.not.ALLOCATED(coslon)) ALLOCATE(coslon(1)) 152 136 137 ! read nq from traceur.def 138 open(90,file='traceur.def',status='old',form='formatted', 139 & iostat=ierr) 140 if (ierr.eq.0) then 141 read(90,*,iostat=ierr) nq 142 else 143 nq=0 144 endif 145 close(90) 146 147 ! Initialize dimphy module 148 call init_dimphy(1,llm) 149 ! now initialize arrays using phys_state_var_init 150 call phys_state_var_init(nq) 151 153 152 saveprofile=.false. 154 153 saveprofile=.true. … … 480 479 ! call init_vertical_layers(nlayer,preff,scaleheight, 481 480 ! & ap,bp,aps,bps,presnivs,pseudoalt) 482 call init_dimphy(1,nlayer) ! Initialize dimphy module481 ! call init_dimphy(1,nlayer) ! Initialize dimphy module 483 482 call ini_planete_mod(nlayer,preff,ap,bp) 484 483 … … 643 642 endif 644 643 645 call disvert 644 call disvert_noterre 646 645 ! now that disvert has been called, initialize module vertical_layers_mod 647 646 call init_vertical_layers(nlayer,preff,scaleheight, … … 669 668 ENDDO 670 669 670 671 671 672 DO ilayer=1,nlayer 672 673 ! zlay(ilayer)=-300.E+0 *r*log(play(ilayer)/plev(1)) -
trunk/LMDZ.TITAN/libf/phytitan/dyn1d/serre_mod.F90
r1422 r2366 1 link ../../ dyn3d/serre_mod.F901 link ../../../../LMDZ.COMMON/libf/dyn3d_common/serre_mod.F90 -
trunk/LMDZ.TITAN/libf/phytitan/gfluxi.F
r2095 r2366 85 85 LAMDA(L) = ALPHA(L)*(1.0D0-W0(L)*COSBAR(L))/UBARI 86 86 87 NT = int(TLEV(2*L)*NTfac) - NTstar +188 NT2 = int(TLEV(2*L+2)*NTfac) - NTstar +187 NT = int(TLEV(2*L)*NTfac) - NTstart+1 88 NT2 = int(TLEV(2*L+2)*NTfac) - NTstart+1 89 89 90 90 ! AB : PLANCKIR(NW,NT) is replaced by P1, the linear interpolation result for a temperature NT … … 112 112 ! -- same results for most thin atmospheres 113 113 ! -- and stabilizes integrations 114 NT = int(TLEV(2*L+1)*NTfac) - NTstar +1114 NT = int(TLEV(2*L+1)*NTfac) - NTstart+1 115 115 !! For deep, opaque, thick first layers (e.g. Saturn) 116 116 !! what is below works much better, not unstable, ... 117 117 !! ... and actually fully accurate because 1st layer temp (JL) 118 !NT = int(TLEV(2*L)*NTfac) - NTstar +1118 !NT = int(TLEV(2*L)*NTfac) - NTstart+1 119 119 !! (or this one yields same results 120 !NT = int( (TLEV(2*L)+TLEV(2*L+1))*0.5*NTfac ) - NTstar +1121 122 NT2 = int(TLEV(2*L)*NTfac) - NTstar +1120 !NT = int( (TLEV(2*L)+TLEV(2*L+1))*0.5*NTfac ) - NTstart+1 121 122 NT2 = int(TLEV(2*L)*NTfac) - NTstart+1 123 123 124 124 ! AB : PLANCKIR(NW,NT) is replaced by P1, the linear interpolation result for a temperature NT -
trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
r2245 r2366 11 11 use init_print_control_mod, only: init_print_control 12 12 use radinc_h, only: ini_radinc_h 13 use datafile_mod14 13 use comdiurn_h, only: sinlat, coslat, sinlon, coslon 15 14 use comgeomfi_h, only: totarea, totarea_planet … … 59 58 ! declarations: 60 59 ! ------------- 60 use datafile_mod 61 61 use ioipsl_getin_p_mod, only: getin_p 62 62 IMPLICIT NONE … … 90 90 91 91 ! Initialize some "temporal and calendar" related variables 92 #ifndef MESOSCALE 92 93 CALL init_time(day_ini,pdaysec,nday,ptimestep) 94 #endif 93 95 94 96 ! read in some parameters from "run.def" for physics, … … 147 149 call getin_p("season",season) 148 150 write(*,*) " season = ",season 151 152 write(*,*) "No seasonal cycle: initial day to lock the run during restart" 153 noseason_day=0.0 ! default value 154 call getin_p("noseason_day",noseason_day) 155 write(*,*) "noseason_day=", noseason_day 149 156 150 157 write(*,*) "Tidally resonant rotation ?" … … 276 283 write(*,*) "strictboundcorrk = ",strictboundcorrk 277 284 285 write(*,*) "Minimum atmospheric temperature for Planck function integration ?" 286 tplanckmin=30.0 ! default value 287 call getin_p("tplanckmin",tplanckmin) 288 write(*,*) " tplanckmin = ",tplanckmin 289 290 write(*,*) "Maximum atmospheric temperature for Planck function integration ?" 291 tplanckmax=1500.0 ! default value 292 call getin_p("tplanckmax",tplanckmax) 293 write(*,*) " tplanckmax = ",tplanckmax 294 295 write(*,*) "Temperature step for Planck function integration ?" 296 dtplanck=0.1 ! default value 297 call getin_p("dtplanck",dtplanck) 298 write(*,*) " dtplanck = ",dtplanck 299 278 300 write(*,*) "call gaseous absorption in the visible bands?", & 279 301 "(matters only if callrad=T)" … … 548 570 endif ! of if (force_cpp) 549 571 550 551 572 call su_gases(nlayer,tracer) 552 call calc_cpp_mugaz 553 554 573 call calc_cpp_mugaz 574 555 575 PRINT*,'--------------------------------------------' 556 576 PRINT* … … 579 599 580 600 ! Initializations for comgeomfi_h 601 #ifndef MESOSCALE 581 602 totarea=SSUM(ngrid,parea,1) 582 603 call planetwide_sumval(parea,totarea_planet) … … 594 615 coslon(ig)=cos(plon(ig)) 595 616 ENDDO 596 617 #endif 597 618 ! initialize variables in radinc_h 598 call ini_radinc_h(nlayer )619 call ini_radinc_h(nlayer,tplanckmin,tplanckmax,dtplanck) 599 620 600 621 ! allocate "comsoil_h" arrays 601 622 call ini_comsoil_h(ngrid) 602 623 603 624 END SUBROUTINE inifis 604 625 -
trunk/LMDZ.TITAN/libf/phytitan/optcv.F90
r2242 r2366 11 11 callclouds,callmufi,seashaze,uncoupl_optic_haze 12 12 use tracer_h, only: nmicro,nice 13 use MMP_OPTICS14 13 15 14 implicit none -
trunk/LMDZ.TITAN/libf/phytitan/phys_state_var_mod.F90
r2328 r2366 10 10 ! Declaration des variables 11 11 USE dimphy, only : klon,klev 12 use comchem_h, only: nkim 13 USE callkeys_mod, only: callchim 12 14 USE comsoil_h, only : nsoilmx 13 15 use comsaison_h, only: mu0, fract 14 16 use radcommon_h, only: gzlat, gzlat_ig, Cmk 15 17 USE radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind 18 use surfdat_h, only: phisfi, albedodat, & 19 zmea, zstd, zsig, zgam, zthe 16 20 use turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th 17 21 18 real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K) ! Useful for Dynamical Heating calculation. 19 real,allocatable,dimension(:,:),save :: zuprevious ! Previous loop Zonal Wind (m.s-1) ! Useful for Zonal Wind tendency calculation. 22 real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K) 23 ! Useful for Dynamical Heating calculation. 24 real,allocatable,dimension(:,:),save :: zuprevious 25 !$OMP THREADPRIVATE(ztprevious,zuprevious) 20 26 21 27 real, dimension(:),allocatable,save :: tsurf ! Surface temperature (K). … … 40 46 real,dimension(:),allocatable,save :: fluxgrd ! Surface conduction flux (W.m-2). 41 47 real,dimension(:,:),allocatable,save :: qsurf ! Tracer on surface (e.g. kg.m-2). 42 43 48 !$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf,q2) 44 49 … … 48 53 real,dimension(:),allocatable,save :: fluxsurf_sw ! Incident Short Wave (stellar) surface flux (W.m-2). 49 54 real,dimension(:),allocatable,save :: fluxsurfabs_sw ! Absorbed Short Wave (stellar) flux by the surface (W.m-2). 55 !$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw) 50 56 51 57 real,dimension(:),allocatable,save :: fluxtop_lw ! Outgoing LW (IR) flux to space (W.m-2). … … 53 59 real,dimension(:),allocatable,save :: fluxtop_dn ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2). 54 60 real,dimension(:),allocatable,save :: fluxdyn ! Horizontal heat transport by dynamics (W.m-2). 61 !$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn) 55 62 56 63 real,dimension(:,:),allocatable,save :: OLR_nu ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)). … … 59 66 real,dimension(:,:),allocatable,save :: zdtsw ! SW heating tendencies (K/s). 60 67 !real,dimension(:),allocatable,save :: sensibFlux ! Turbulent flux given by the atmosphere to the surface (W.m-2). 68 !$OMP THREADPRIVATE(OLR_nu,OSR_nu,zdtlw,zdtsw) 69 61 70 real,dimension(:,:,:),allocatable,save :: int_dtauv ! VI optical thickness of layers within narrowbands for diags (). 62 71 real,dimension(:,:,:),allocatable,save :: int_dtaui ! IR optical thickness of layers within narrowbands for diags (). 63 64 !$OMPTHREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu,& 65 !$OMP zdtlw,zdtsw,sensibFlux,int_dtauv,int_dtaui)) 72 !$OMP THREADPRIVATE(int_dtaui,int_dtauv) 66 73 67 74 real,allocatable,dimension(:,:),save :: qsurf_hist 68 75 !$OMP THREADPRIVATE(qsurf_hist) 76 77 ! For chemistry 78 real, dimension(:,:,:), allocatable, save :: dycchi ! NB : Only for chem tracers. Saved since chemistry is not called every step. 79 !$OMP THREADPRIVATE(dycchi) 69 80 70 81 CONTAINS … … 119 130 ALLOCATE(int_dtaui(klon,klev,L_NSPECTI)) 120 131 ALLOCATE(int_dtauv(klon,klev,L_NSPECTV)) 132 allocate(dycchi(klon,klev,nkim)) 121 133 ! This is defined in comsaison_h 122 134 ALLOCATE(mu0(klon)) … … 126 138 ALLOCATE(gzlat_ig(klev)) 127 139 ALLOCATE(Cmk(klev)) 140 ! This is defined in surfdat_h 141 ALLOCATE(albedodat(klon)) 142 ALLOCATE(phisfi(klon)) 143 ALLOCATE(zmea(klon)) 144 ALLOCATE(zstd(klon)) 145 ALLOCATE(zsig(klon)) 146 ALLOCATE(zgam(klon)) 147 ALLOCATE(zthe(klon)) 128 148 ! This is defined in turb_mod 129 149 allocate(wstar(klon)) … … 171 191 DEALLOCATE(int_dtaui) 172 192 DEALLOCATE(int_dtauv) 193 DEALLOCATE(dycchi) 173 194 DEALLOCATE(mu0) 174 195 DEALLOCATE(fract) … … 176 197 DEALLOCATE(gzlat_ig) 177 198 DEALLOCATE(Cmk) 199 DEALLOCATE(phisfi) 200 DEALLOCATE(albedodat) 201 DEALLOCATE(zmea) 202 DEALLOCATE(zstd) 203 DEALLOCATE(zsig) 204 DEALLOCATE(zgam) 205 DEALLOCATE(zthe) 178 206 deallocate(wstar) 179 207 deallocate(ustar) -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r2328 r2366 16 16 use radinc_h, only : L_NSPECTI,L_NSPECTV 17 17 use radcommon_h, only: sigma, gzlat, grav, BWNV 18 use surfdat_h, only: phisfi, zmea, zstd, zsig, zgam, zthe19 18 use comchem_h, only: nkim, cnames, nlaykim_up, ykim_up, ykim_tot, botCH4 20 19 use comdiurn_h, only: coslat, sinlat, coslon, sinlon … … 34 33 use comcstfi_mod, only: pi, g, rcp, r, rad, mugaz, cpp 35 34 use time_phylmdz_mod, only: daysec 35 #ifndef MESOSCALE 36 36 use logic_mod, only: moyzon_ch 37 37 use moyzon_mod, only: zphibar, zphisbar, zplevbar, zplaybar, & 38 38 zzlevbar, zzlaybar, ztfibar, zqfibar 39 #endif 39 40 use callkeys_mod 40 41 use phys_state_var_mod … … 42 43 #ifndef MESOSCALE 43 44 use vertical_layers_mod, only: presnivs, pseudoalt 44 use ioipsl_getin_p_mod, only: getin_p45 45 use mod_phys_lmdz_omp_data, ONLY: is_omp_master 46 46 #else … … 56 56 use wxios, only: wxios_context_init, xios_context_finalize 57 57 #endif 58 use MMP_OPTICS59 58 use muphy_diag 60 59 implicit none … … 177 176 ! ------- 178 177 179 180 178 integer,intent(in) :: ngrid ! Number of atmospheric columns. 181 179 integer,intent(in) :: nlayer ! Number of atmospheric layers. … … 211 209 ! Local saved variables: 212 210 ! ---------------------- 213 214 211 integer,save :: day_ini ! Initial date of the run (sol since Ls=0). 215 212 integer,save :: icount ! Counter of calls to physiq during the run. 216 213 !$OMP THREADPRIVATE(day_ini,icount) 217 214 218 215 ! Local variables : … … 289 286 290 287 291 292 288 ! local variables for DIAGNOSTICS : (diagfi & stat) 293 289 ! ------------------------------------------------- … … 299 295 real zdtdyn(ngrid,nlayer) ! Dynamical Heating (K/s). 300 296 real zdudyn(ngrid,nlayer) ! Dynamical Zonal Wind tendency (m.s-2). 301 !$OMP THREADPRIVATE(ztprevious,zuprevious)302 297 303 298 real zhorizwind(ngrid,nlayer) ! Horizontal Wind ( sqrt(u**+v*v)) … … 329 324 real tf, ntf 330 325 331 !$OMP THREADPRIVATE(qsurf_hist)332 333 326 ! Miscellaneous : 334 327 character(len=10) :: tmp1 … … 336 329 337 330 character*2 :: str2 331 332 #ifndef MESOSCALE 338 333 339 334 ! Local variables for Titan chemistry and microphysics … … 348 343 349 344 ! Molar fraction tendencies ( chemistry, condensation and evaporation ) for tracers (mol/mol/s) 350 real, dimension(:,:,:), allocatable, save :: dycchi ! NB : Only for chem tracers. Saved since chemistry is not called every step.351 !$OMP THREADPRIVATE(dycchi)352 345 real, dimension(ngrid,nlayer,nq) :: dyccond ! Condensation rate. NB : for all tracers, as we want to use indx on it. 353 346 real, dimension(ngrid,nlayer,nq) :: dyccondbar ! For 2D chemistry … … 360 353 real :: i2e(ngrid,nlayer) ! int 2 ext factor ( X.kg-1 -> X.m-3 for diags ) 361 354 355 #ifdef USE_QTEST 362 356 real,save,dimension(:,:,:), allocatable :: tpq ! Tracers for decoupled microphysical tests ( temporary in 01/18 ) 363 357 !$OMP THREADPRIVATE(tpq) 364 358 real,dimension(ngrid,nlayer,nq) :: dtpq ! (temporary in 01/18) 359 #endif 365 360 366 361 logical file_ok … … 385 380 END SUBROUTINE calmufi 386 381 END INTERFACE 382 383 #endif 387 384 388 385 !================================================================================================== … … 396 393 ! -------------------------------- 397 394 if (firstcall) then 398 #ifndef MESOSCALE 395 396 #ifdef USE_QTEST 399 397 allocate(tpq(ngrid,nlayer,nq)) 400 398 tpq(:,:,:) = pq(:,:,:) 401 399 #endif 402 400 ! Initialisation of nmicro as well as tracers names, indexes ... 403 401 if (ngrid.ne.1) then ! Already done in rcm1d … … 405 403 endif 406 404 407 call phys_state_var_init(nq) 408 405 ! Allocate saved arrays (except for 1D model, where this has already been done) 406 #ifndef MESOSCALE 407 if (ngrid>1) call phys_state_var_init(nq) 409 408 #endif 410 409 … … 453 452 endif 454 453 454 #ifndef MESOSCALE 455 455 ! Initialize names and timestep for chemistry 456 456 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 463 463 stop 464 464 endif 465 466 allocate(dycchi(ngrid,nlayer,nkim)) ! only for chemical tracers 467 465 468 466 ! Chemistry timestep 469 467 ctimestep = ptimestep*REAL(ichim) … … 482 480 483 481 ENDIF 482 #endif 484 483 485 484 #ifdef CPP_XIOS … … 492 491 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 493 492 #ifndef MESOSCALE 494 call phyetat0(startphy_file,ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 493 call phyetat0(startphy_file, & 494 ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 495 495 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,tankCH4) 496 496 #else … … 498 498 q2(:,:)=0.0 499 499 qsurf(:,:)=0.0 500 tankCH4(:)=0.0 500 501 day_ini = pday 501 502 #endif … … 534 535 call iniorbit(apoastr,periastr,year_day,peri_day,obliquit) 535 536 537 536 538 if(tlocked)then 537 539 print*,'Planet is tidally locked at resonance n=',nres … … 576 578 577 579 #ifndef MESOSCALE 578 if (ngrid.ne.1) then 579 ! Note : no need to create a restart file in 1d. 580 if (ngrid.ne.1) then ! Note : no need to create a restart file in 1d. 580 581 call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, & 581 582 583 endif 584 #endif 582 ptimestep,pday+nday,time_phys,cell_area, & 583 albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe) 584 endif 585 #endif 585 586 586 587 ! XIOS outputs … … 624 625 call stellarlong(zday,zls) 625 626 else 626 call stellarlong( float(day_ini),zls)627 call stellarlong(noseason_day,zls) 627 628 end if 628 629 … … 686 687 ! JVO 19 : We shall always have correct altitudes in chemistry no matter what's in physics 687 688 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 689 #ifndef MESOSCALE 688 690 if (moyzon_ch) then ! Zonal averages 689 691 … … 716 718 717 719 else ! if not moyzon 720 #endif 718 721 719 722 DO ig=1,ngrid … … 730 733 ENDDO 731 734 735 #ifndef MESOSCALE 732 736 endif ! moyzon 737 #endif 733 738 734 739 ! ------------------------------------------------------------------------------------- … … 1028 1033 if (tracer) then 1029 1034 1035 1036 #ifndef MESOSCALE 1037 !! JVO 20 : For now, no chemistry or microphysics in MESOSCALE, but why not in the future ? 1038 1030 1039 ! ------------------- 1031 1040 ! V.1 Microphysics … … 1195 1204 1196 1205 endif ! end of 'callchim' 1206 1207 #endif 1197 1208 1198 1209 ! --------------- -
trunk/LMDZ.TITAN/libf/phytitan/radcommon_h.F90
r2133 r2366 1 1 module radcommon_h 2 use radinc_h, only: L_NSPECTI, L_NSPECTV, NTstar , NTstop2 use radinc_h, only: L_NSPECTI, L_NSPECTV, NTstart, NTstop 3 3 implicit none 4 4 … … 78 78 REAL,SAVE :: tstellar ! Stellar brightness temperature (SW) 79 79 80 real*8,save :: planckir(L_NSPECTI,NTstop-NTstar+1)80 REAL*8, DIMENSION(:,:), ALLOCATABLE, SAVE :: planckir 81 81 82 82 real*8,save :: PTOP -
trunk/LMDZ.TITAN/libf/phytitan/radinc_h.F90
r2050 r2366 72 72 73 73 ! For Planck function integration: 74 ! equivalent temperatures are 1/NTfac of these values75 integer, parameter :: NTstar = 50076 integer, parameter :: NTstop = 15000 ! new default for all non hot Jupiter runs77 real*8, parameter :: NTfac = 1.0D+178 ! integer, parameter :: NTstar = 100079 ! integer, parameter :: NTstop = 2500080 ! real*8,parameter :: NTfac = 5.0D+181 !integer, parameter :: NTstar = 200082 !integer, parameter :: NTstop = 5000083 !real*8,parameter :: NTfac = 1.0D+2 74 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 ! Integration boundary temperatures are NTstart/NTfac and Ntstop/NTfac 76 ! -- JVO 20 : Now read boundary T and integration dT as inputs in callphys.def 77 ! NTstart, Nstop and NTfac then set by ini_radinc_h 78 ! Smart user can adjust values depending he's running hot or cold atm 79 ! Default is wide range : 30K-1500K, with 0.1K step 80 ! -> NTstart=300, Nstop=15000, NTfac=10 81 integer :: NTstart, NTstop 82 real*8 :: NTfac 83 84 84 85 85 contains 86 86 87 subroutine ini_radinc_h(nbp_lev )87 subroutine ini_radinc_h(nbp_lev,tplanckmin,tplanckmax,dtplanck) 88 88 ! Initialize module variables 89 89 implicit none 90 90 integer,intent(in) :: nbp_lev 91 real*8, intent(in) :: tplanckmin 92 real*8, intent(in) :: tplanckmax 93 real*8, intent(in) :: dtplanck 91 94 92 95 L_NLAYRAD = nbp_lev 93 L_LEVELS = 2*(nbp_lev-1)+396 L_LEVELS = 2*(nbp_lev-1)+3 94 97 L_NLEVRAD = nbp_lev+1 95 98 99 NTfac = 1.D0 / dtplanck 100 NTstart = int(tplanckmin * NTfac) 101 NTstop = int(tplanckmax * NTfac) 102 96 103 end subroutine 97 104 -
trunk/LMDZ.TITAN/libf/phytitan/setspi.F90
r1897 r2366 22 22 !================================================================== 23 23 24 use radinc_h, only: L_NSPECTI,NTstar ,NTstop,NTfac24 use radinc_h, only: L_NSPECTI,NTstart,NTstop,NTfac 25 25 use radcommon_h, only: BWNI,WNOI,DWNI,WAVEI,planckir,sigma 26 26 use datafile_mod, only: datadir, corrkdir, banddir … … 151 151 print*,'' 152 152 print*,'setspi: Current Planck integration range:' 153 print*,'T = ',dble(NTstar)/NTfac, ' to ',dble(NTstop)/NTfac,' K.' 153 print*,'T = ',dble(NTstart)/NTfac, ' to ',dble(NTstop)/NTfac,' K.' 154 155 IF(.NOT.ALLOCATED(planckir)) ALLOCATE(planckir(L_NSPECTI,NTstop-NTstart+1)) 154 156 155 157 do NW=1,L_NSPECTI … … 158 160 bpa = (b+a)/2.0D0 159 161 bma = (b-a)/2.0D0 160 do nt=NTstar ,NTstop162 do nt=NTstart,NTstop 161 163 T = dble(NT)/NTfac 162 164 ans = 0.0D0 … … 167 169 end do 168 170 169 planckir(NW,nt-NTstar +1) = ans*bma/(PI*DWNI(NW))171 planckir(NW,nt-NTstart+1) = ans*bma/(PI*DWNI(NW)) 170 172 end do 171 173 end do … … 174 176 if(forceEC)then 175 177 print*,'setspi: Force F=sigma*eps*T^4 for all values of T!' 176 do nt=NTstar ,NTstop178 do nt=NTstart,NTstop 177 179 plancksum=0.0D0 178 180 T=dble(NT)/NTfac … … 180 182 do NW=1,L_NSPECTI 181 183 plancksum=plancksum+ & 182 planckir(NW,nt-NTstar +1)*DWNI(NW)*pi184 planckir(NW,nt-NTstart+1)*DWNI(NW)*pi 183 185 end do 184 186 185 187 do NW=1,L_NSPECTI 186 planckir(NW,nt-NTstar +1)= &187 planckir(NW,nt-NTstar +1)* &188 planckir(NW,nt-NTstart+1)= & 189 planckir(NW,nt-NTstart+1)* & 188 190 sigma*(dble(nt)/NTfac)**4/plancksum 189 191 end do … … 194 196 ! check energy conservation at lower temperature boundary 195 197 plancksum=0.0D0 196 nt=NTstar 198 nt=NTstart 197 199 do NW=1,L_NSPECTI 198 plancksum=plancksum+planckir(NW,nt-NTstar +1)*DWNI(NW)*pi200 plancksum=plancksum+planckir(NW,nt-NTstart+1)*DWNI(NW)*pi 199 201 end do 200 202 print*,'setspi: At lower limit:' … … 206 208 nt=NTstop 207 209 do NW=1,L_NSPECTI 208 plancksum=plancksum+planckir(NW,nt-NTstar +1)*DWNI(NW)*pi210 plancksum=plancksum+planckir(NW,nt-NTstart+1)*DWNI(NW)*pi 209 211 end do 210 212 print*,'setspi: At upper limit:' -
trunk/LMDZ.TITAN/libf/phytitan/sfluxi.F
r2095 r2366 67 67 TSURF = TLEV(L_LEVELS) 68 68 69 NTS = int(TSURF*NTfac)-NTstar +170 NTT = int(TTOP *NTfac)-NTstar +169 NTS = int(TSURF*NTfac)-NTstart+1 70 NTT = int(TTOP *NTfac)-NTstart+1 71 71 72 72 !JL12 corrects the surface planck function so that its integral is equal to sigma Tsurf^4
Note: See TracChangeset
for help on using the changeset viewer.