Changeset 3344 for trunk/LMDZ.MARS


Ignore:
Timestamp:
May 23, 2024, 4:17:52 PM (6 months ago)
Author:
jbclement
Message:

Mars PCM:
Modification of "iniwritesoil.F90": 'nsoilmx' and 'mlayer' are now arguments + making it as a module.
JBC

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/changelog.txt

    r3343 r3344  
    46494649== 23/05/2024 == LL
    46504650Small correction of how qsurf of co2 is initialized in the south pole.
    4651 Some correction for the albedo of co2 ice when using paleoclimate: a uniform value (albedo_co2_cap) is used for both hemisphere for CO2 frost, and a different (higher) value is used for perennial ice.
     4651Some correction for the albedo of co2 ice when using paleoclimate: a uniform value (albedo_co2_cap) is used for both hemisphere for CO2 frost, and a different (higher) value is used for perennial ice.
     4652
     4653== 23/05/2024 == JBC
     4654Modification of "iniwritesoil.F90": 'nsoilmx' and 'mlayer' are now arguments + making it as a module.
  • trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90

    r2573 r3344  
    1 subroutine iniwritesoil(nid,ngrid,inertia,area,nbplon,nbplat)
     1module iniwritesoil_mod
     2
     3implicit none
     4
     5contains
     6
     7subroutine iniwritesoil(nid,ngrid,inertia,area,nbplon,nbplat,nsoilmx,mlayer)
    28
    39! initialization routine for 'writediagoil'. Here we create/define
     
    511! (time-independent) parameters.
    612
    7 use comsoil_h, only: mlayer, nsoilmx
    813USE comcstfi_h, only: pi
    914USE regular_lonlat_mod, ONLY: lon_reg, lat_reg
     
    1520
    1621! Arguments:
    17 integer,intent(in) :: ngrid
    18 integer,intent(in) :: nid ! NetCDF output file ID
    19 real,intent(in) :: inertia(nbplon,nbplat,nsoilmx)
    20 real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2)
    21 integer,intent(in) :: nbplon,nbplat ! sizes of area
     22integer, intent(in) :: ngrid
     23integer, intent(in) :: nid                  ! NetCDF output file ID
     24integer, intent(in) :: nbplon, nbplat       ! sizes of area
     25integer, intent(in) :: nsoilmx              ! number of subterranean layers
     26real,    intent(in) :: inertia(nbplon,nbplat,nsoilmx)
     27real,    intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2)
     28real,    intent(in) :: mlayer(nsoilmx)      ! soil mid-layer depths
    2229
    2330! Local variables:
     
    6370endif
    6471ierr=NF_DEF_DIM(nid,"depth",nsoilmx,idim_depth)
    65 ! nsoilmx known from comsoil_h
    6672if (ierr.ne.NF_NOERR) then
    6773  write(*,*)"iniwritesoil: Error, could not define depth dimension"
     
    174180ierr=NF_PUT_VAR_REAL(nid,varid,mlayer)
    175181#endif
    176 ! Note mlayer(0:nsoilmx-1) known from comsoil_h
    177182if (ierr.ne.NF_NOERR) then
    178183  write(*,*)"iniwritesoil: Error, could not write depth variable"
     
    271276
    272277end subroutine iniwritesoil
     278
     279end module iniwritesoil_mod
  • trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90

    r3213 r3344  
    2121! Modifs: Aug.2010 Ehouarn: enforce outputs to be real*4
    2222
    23 use comsoil_h, only: nsoilmx, inertiedat
     23use comsoil_h, only: mlayer, nsoilmx, inertiedat
    2424use geometry_mod, only: cell_area
    2525use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
    26 use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    27 use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo, nbp_lon, nbp_lat
    28 use mod_grid_phy_lmdz, only : grid_type, unstructured
     26use mod_phys_lmdz_para, only: is_mpi_root, is_master, gather
     27use mod_grid_phy_lmdz, only: klon_glo, Grid1Dto2D_glo, nbp_lon, nbp_lat
     28use mod_grid_phy_lmdz, only: grid_type, unstructured
     29use iniwritesoil_mod, only: iniwritesoil
    2930
    3031implicit none
     
    154155   ! write "header" of file (longitudes, latitudes, geopotential, ...)
    155156   if (klon_glo>1) then ! general 3D case
    156      call iniwritesoil(nid,ngrid,inertia,area,nbp_lon+1,nbp_lat)
     157     call iniwritesoil(nid,ngrid,inertia,area,nbp_lon+1,nbp_lat,nsoilmx,mlayer)
    157158   else ! 1D model
    158      call iniwritesoil(nid,ngrid,inertiafi_glo(1,:),areafi_glo(1),1,1)
     159     call iniwritesoil(nid,ngrid,inertiafi_glo(1,:),areafi_glo(1),1,1,nsoilmx,mlayer)
    159160   endif
    160161
Note: See TracChangeset for help on using the changeset viewer.