PROGRAM testphys1d use comsoil_h, only: inertiedat, inertiesoil, nsoilmx, tsoil, nqsoil, qsoil use surfdat_h, only: albedodat, perennial_co2ice, watercap, tsurf, emis, qsurf use comslope_mod, only: def_slope, subslope_dist use phyredem, only: physdem0, physdem1 use watersat_mod, only: watersat use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice, noms use comcstfi_h, only: pi, g, rcp, cpp use time_phylmdz_mod, only: daysec use dimradmars_mod, only: tauvis, totcloudfrac, albedo use dust_param_mod, only: tauscaling use comvert_mod, only: ap, bp, aps, bps, pa, preff use physiq_mod, only: physiq use turb_mod, only: q2 use write_output_mod, only: write_output use ioipsl_getincom, only: getin ! To use 'getin' use init_testphys1d_mod, only: init_testphys1d use writerestart1D_mod, only: writerestart1D use parse_args_mod, only: parse_args use callkeys_mod, only: water ! Mostly for XIOS outputs use mod_const_mpi, only: init_const_mpi use parallel_lmdz, only: init_parallel implicit none !======================================================================= ! subject: ! -------- ! PROGRAM useful to run physical part of the martian GCM in a 1D column ! ! Can be compiled with a command like (e.g. for 25 layers) ! "makegcm -p mars -d 25 testphys1d" ! It requires the files "testphys1d.def" "callphys.def" ! and a 'run.def' file (containing a "INCLUDEDEF=callphys.def" line) ! and a file describing the sigma layers (e.g. "z2sig.def") ! ! author: Frederic Hourdin, R. Fournier, F. Forget ! ------- ! ! update: 12/06/2003, including chemistry (S. Lebonnois) ! and water ice (F. Montmessin) ! 27/09/2023, upgrade to F90 (JB Clément) ! !======================================================================= include "dimensions.h" !-------------------------------------------------------------- ! Declarations !-------------------------------------------------------------- integer, parameter :: ngrid = 1 ! (2+(jjm-1)*iim - 1/jjm) integer, parameter :: nlayer = llm real, parameter :: odpref = 610. ! DOD reference pressure (Pa) integer :: ndt, ilayer, idt logical :: firstcall, lastcall integer :: day0 ! initial (sol ; =0 at Ls=0) real :: day ! date during the run real :: time ! time (0 1.) then time = time - 1. day = day + 1 endif ! Compute winds for next time step ! -------------------------------- u = u + dttestphys*du v = v + dttestphys*dv ! Compute temperature for next time step ! -------------------------------------- temp = temp + dttestphys*dtemp ! Compute pressure for next time step ! ----------------------------------- psurf = psurf + dttestphys*dpsurf(1) ! Surface pressure change plev = ap + psurf*bp play = aps + psurf*bps ! Compute tracers for next time step ! ---------------------------------- q = q + dttestphys*dq enddo ! End of time stepping loop (idt=1,ndt) ! Writing the "restart1D.txt" file for the next run if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,pa,preff,tsurf(1,:),nlayer,size(tsurf,2),temp,u,v,nq,noms,q) write(*,*) "testphys1d: everything is cool!" END PROGRAM testphys1d !*********************************************************************** !*********************************************************************** ! Dummy subroutine used only in 3D, but required to ! compile testphys1d (to cleanly use writediagfi) SUBROUTINE gr_fi_dyn(nfield,ngrid,im,jm,pfi,pdyn) implicit none integer :: im, jm, ngrid, nfield real, dimension(im,jm,nfield) :: pdyn real, dimension(ngrid,nfield) :: pfi if (ngrid /= 1) error stop 'gr_fi_dyn error: in 1D ngrid should be 1!!!' pdyn(1,1,1:nfield) = pfi(1,1:nfield) END SUBROUTINE gr_fi_dyn !*********************************************************************** !***********************************************************************