- Timestamp:
- Nov 17, 2023, 2:38:58 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.