Changeset 3129
- Timestamp:
- Nov 17, 2023, 2:38:58 PM (14 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3123 r3129 258 258 259 259 ! Dummy variables to use the subroutine 'init_testphys1d' 260 logical :: startfiles_1D,therestart1D, therestartfi260 logical :: therestart1D, therestartfi 261 261 integer :: ndt, day0 262 262 real :: ptif, pks, day, gru, grv, atm_wat_profile, atm_wat_tau … … 308 308 allocate(q(1,llm,nqtot)) 309 309 allocate(longitude(1),latitude(1),cell_area(1)) 310 call init_testphys1d(.true.,ngrid,nlayer,610.,nq,q,time_0,ps(1),ucov,vcov,teta,startfiles_1D,therestart1D, & 311 therestartfi,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 310 311 therestart1D = .false. 312 inquire(file = 'start1D_evol.txt',exist = therestart1D) 313 if (.not. therestart1D) then 314 write(*,*) 'There is no "start1D_evol.txt" file!' 315 error stop 'Initialization cannot be done for the 1D PEM.' 316 endif 317 therestartfi = .false. 318 inquire(file = 'startfi_evol.nc',exist = therestartfi) 319 if (.not. therestartfi) then 320 write(*,*) 'There is no "startfi_evol.nc" file!' 321 error stop 'Initialization cannot be done for the 1D PEM.' 322 endif 323 324 call init_testphys1d('start1D_evol.txt','startfi_evol.nc',.true.,therestart1D,therestartfi,ngrid,nlayer,610., & 325 nq,q,time_0,ps(1),ucov,vcov,teta,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 312 326 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 313 327 ps(2) = ps(1) -
trunk/LMDZ.MARS/changelog.txt
r3128 r3129 4348 4348 == 17/11/2023 == JBC 4349 4349 Correction of a bug related to r3126: 'choice_ads' did not have a default value which made the model crash. 'choice_ads = 0' is the default value (no adsorption). 4350 Cleaning of the 1D initialization: any reference of the PEM has been removed from "init_testphys1D_mod.F90". This way is much cleaner even though it needs more code. -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3117 r3129 5 5 contains 6 6 7 SUBROUTINE init_testphys1d( pem1d,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D, &8 therestartfi,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,&7 SUBROUTINE init_testphys1d(start1Dname,startfiname,startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref, & 8 nq,q,time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 9 9 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 10 10 … … 38 38 use phys_state_var_init_mod, only: phys_state_var_init 39 39 use turb_mod, only: q2 40 use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd41 use conf_phys_mod, only: conf_phys40 use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd 41 use conf_phys_mod, only: conf_phys 42 42 ! Mostly for XIOS outputs: 43 43 use mod_const_mpi, only: COMM_LMDZ … … 51 51 ! Arguments 52 52 !======================================================================= 53 integer, intent(in) :: ngrid, nlayer 54 real, intent(in) :: odpref ! DOD reference pressure (Pa) 55 logical, intent(in) :: pem1d ! If initialization for the 1D PEM 53 integer, intent(in) :: ngrid, nlayer 54 real, intent(in) :: odpref ! DOD reference pressure (Pa) 55 character(*), intent(in) :: start1Dname, startfiname ! Name of starting files for 1D 56 logical, intent(in) :: startfiles_1D, therestart1D, therestartfi ! Use of starting files for 1D 56 57 57 58 integer, intent(inout) :: nq … … 62 63 real, dimension(nlayer), intent(out) :: u, v ! zonal, meridional wind 63 64 real, dimension(nlayer), intent(out) :: temp ! temperature at the middle of the layers 64 logical, intent(out) :: startfiles_1D, therestart1D, therestartfi ! Use of starting files for 1D65 65 integer, intent(out) :: ndt 66 66 real, intent(out) :: ptif, pks … … 91 91 ! RV & JBC: Use of starting files for 1D 92 92 logical :: found 93 character( len = 30):: header93 character(30) :: header 94 94 real, dimension(100) :: tab_cntrl 95 95 real, dimension(1,2,1) :: albedo_read ! surface albedo … … 100 100 101 101 ! MVals: isotopes as in the dynamics (CRisi) 102 integer 103 character( len =30), dimension(:), allocatable :: tnom_transp ! transporting fluid short name104 character( len =80) :: line ! to store a line of text105 logical :: continu, there102 integer :: ifils, ipere, generation, ierr0 103 character(30), dimension(:), allocatable :: tnom_transp ! transporting fluid short name 104 character(80) :: line ! to store a line of text 105 logical :: continu 106 106 107 107 ! LL: Possibility to add subsurface ice … … 113 113 real :: flux_geo_tmp 114 114 115 ! JBC: To initialize the 1D PEM116 character(:), allocatable :: start1Dname, startfiname ! Name of starting files for 1D117 118 115 !======================================================================= 119 116 ! Code 120 117 !======================================================================= 121 if (.not. pem1d) then122 start1Dname = 'start1D.txt'123 startfiname = 'startfi.nc'124 startfiles_1D = .false.125 !------------------------------------------------------126 ! Loading run parameters from "run.def" file127 !------------------------------------------------------128 ! check if 'run.def' file is around. Otherwise reading parameters129 ! from callphys.def via getin() routine won't work.130 inquire(file = 'run.def',exist = there)131 if (.not. there) then132 write(*,*) 'Cannot find required file "run.def"'133 write(*,*) ' (which should contain some input parameters along with the following line: INCLUDEDEF=callphys.def)'134 write(*,*) ' ... might as well stop here ...'135 error stop136 endif137 138 write(*,*)'Do you want to use starting files and/or to write restarting files?'139 call getin("startfiles_1D",startfiles_1D)140 write(*,*) " startfiles_1D = ", startfiles_1D141 else142 start1dname = 'start1D_evol.txt'143 startfiname = 'startfi_evol.nc'144 startfiles_1D = .true.145 endif146 147 therestart1D = .false.148 therestartfi = .false.149 inquire(file = start1Dname,exist = therestart1D)150 if (startfiles_1D .and. .not. therestart1D) then151 write(*,*) 'There is no "'//start1Dname//'" file!'152 if (.not. pem1d) then153 write(*,*) 'Initialization is done with default values.'154 else155 error stop 'Initialization cannot be done for the 1D PEM.'156 endif157 endif158 inquire(file = startfiname,exist = therestartfi)159 if (.not. therestartfi) then160 write(*,*) 'There is no "'//startfiname//'" file!'161 if (.not. pem1d) then162 write(*,*) 'Initialization is done with default values.'163 else164 error stop 'Initialization cannot be done for the 1D PEM.'165 endif166 endif167 168 118 !------------------------------------------------------ 169 119 ! Prescribed constants to be set here … … 309 259 time = time/24. ! convert time (hours) to fraction of sol 310 260 else 311 call open_startphy( startfiname)261 call open_startphy(trim(startfiname)) 312 262 call get_var("controle",tab_cntrl,found) 313 263 if (.not. found) then … … 351 301 call getin("psurf",psurf) 352 302 else 353 open(3,file = start1Dname,status = "old",action = "read")303 open(3,file = trim(start1Dname),status = "old",action = "read") 354 304 read(3,*) header, psurf 355 305 endif … … 683 633 ! check if "h2o_vap" has already been initialized 684 634 ! (it has been if there is a "profile_h2o_vap" file around) 685 inquire(file = "profile_h2o_vap",exist = there)686 if ( there) then635 inquire(file = "profile_h2o_vap",exist = found) 636 if (found) then 687 637 flagh2o = 0 ! 0: do not initialize h2o_vap 688 638 else -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3117 r3129 15 15 use turb_mod, only: q2 16 16 use write_output_mod, only: write_output 17 use ioipsl_getincom, only: getin ! To use 'getin' 17 18 use init_testphys1d_mod, only: init_testphys1d 18 19 use writerestart1D_mod, only: writerestart1D … … 89 90 integer :: nq = 1 ! number of tracers 90 91 real, dimension(1) :: latitude, longitude, cell_area 91 logical :: there92 92 character(2) :: str2 93 93 character(7) :: str7 … … 95 95 96 96 ! RV & JBC: Use of starting files for 1D 97 logical :: startfiles_1D, therestart1D, therestartfi 97 logical :: startfiles_1D, therestart1D, therestartfi, there 98 98 99 99 ! JN & JBC: Force atmospheric water profiles … … 115 115 !call initcomgeomphy 116 116 117 call init_testphys1d(.false.,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D, & 118 therestartfi,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 117 startfiles_1D = .false. 118 !------------------------------------------------------ 119 ! Loading run parameters from "run.def" file 120 !------------------------------------------------------ 121 ! check if 'run.def' file is around. Otherwise reading parameters 122 ! from callphys.def via getin() routine won't work. 123 inquire(file = 'run.def',exist = there) 124 if (.not. there) then 125 write(*,*) 'Cannot find required file "run.def"' 126 write(*,*) ' (which should contain some input parameters along with the following line: INCLUDEDEF=callphys.def)' 127 write(*,*) ' ... might as well stop here ...' 128 error stop 129 endif 130 131 startfiles_1D = .false. ! Default value 132 write(*,*) 'Do you want to use starting files and/or to write restarting files?' 133 call getin('startfiles_1D',startfiles_1D) 134 write(*,*) 'startfiles_1D =', startfiles_1D 135 136 therestart1D = .false. ! Default value 137 inquire(file = 'start1D.txt',exist = therestart1D) 138 if (startfiles_1D .and. .not. therestart1D) then 139 write(*,*) 'There is no "start1D.txt" file!' 140 write(*,*) 'Initialization is done with default values.' 141 endif 142 therestartfi = .false. ! Default value 143 inquire(file = 'startfi.nc',exist = therestartfi) 144 if (.not. therestartfi) then 145 write(*,*) 'There is no "startfi.nc" file!' 146 write(*,*) 'Initialization is done with default values.' 147 endif 148 149 call init_testphys1d('start1D.txt','startfi.nc',startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref, & 150 nq,q,time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 119 151 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 120 152
Note: See TracChangeset
for help on using the changeset viewer.