Ignore:
Timestamp:
Dec 13, 2024, 5:17:13 PM (10 days ago)
Author:
emillour
Message:

Generic PCM

Modify iostart routines to take netcdf index as an argument in order to
be used to read/write in other files than startfi.nc (preparing 1D
restart)

MM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90

    r3515 r3552  
    22
    33implicit none
     4
     5INTEGER,SAVE :: nid_restart ! NetCDF file identifier for restartfi.nc file
    46
    57contains
     
    8284 
    8385  ! Create physics start file
    84   call create_restartphy(filename)
     86  call create_restartphy(filename,nid_restart)
    8587
    8688! tab_cntrl() contains run parameters
     
    135137
    136138  ! Write the controle array
    137   call put_var("controle","Control parameters",tab_cntrl)
     139  call put_var(nid_restart,"controle","Control parameters",tab_cntrl)
    138140 
    139141  ! Write the controle array descriptor
    140   call put_var("controle_descriptor",&
     142  call put_var(nid_restart,"controle_descriptor",&
    141143               "Description of control parameters",dscrpt_tab_cntrl)
    142144 
    143145  ! Write the mid-layer depths
    144   call put_var("soildepth","Soil mid-layer depth",mlayer)
     146  call put_var(nid_restart,"soildepth","Soil mid-layer depth",mlayer)
    145147 
    146148  ! Write longitudes
    147   call put_field("longitude","Longitudes of physics grid",lonfi)
     149  call put_field(nid_restart,"longitude","Longitudes of physics grid",lonfi)
    148150 
    149151  ! Write latitudes
    150   call put_field("latitude","Latitudes of physics grid",latfi)
     152  call put_field(nid_restart,"latitude","Latitudes of physics grid",latfi)
    151153 
    152154  ! Write mesh areas
    153   call put_field("area","Mesh area",cell_area)
     155  call put_field(nid_restart,"area","Mesh area",cell_area)
    154156 
    155157  ! Write surface geopotential
    156   call put_field("phisfi","Geopotential at the surface",phisfi)
     158  call put_field(nid_restart,"phisfi","Geopotential at the surface",phisfi)
    157159 
    158160  ! Write surface albedo
    159   call put_field("albedodat","Albedo of bare ground",alb)
     161  call put_field(nid_restart,"albedodat","Albedo of bare ground",alb)
    160162 
    161163  ! Subgrid topogaphy variables
    162   call put_field("ZMEA","Relief: mean relief",zmea)
    163   call put_field("ZSTD","Relief: standard deviation",zstd)
    164   call put_field("ZSIG","Relief: sigma parameter",zsig)
    165   call put_field("ZGAM","Relief: gamma parameter",zgam)
    166   call put_field("ZTHE","Relief: theta parameter",zthe)
     164  call put_field(nid_restart,"ZMEA","Relief: mean relief",zmea)
     165  call put_field(nid_restart,"ZSTD","Relief: standard deviation",zstd)
     166  call put_field(nid_restart,"ZSIG","Relief: sigma parameter",zsig)
     167  call put_field(nid_restart,"ZGAM","Relief: gamma parameter",zgam)
     168  call put_field(nid_restart,"ZTHE","Relief: theta parameter",zthe)
    167169 
    168170  ! Soil thermal inertia
    169   call put_field("inertiedat","Soil thermal inertia",ith)
     171  call put_field(nid_restart,"inertiedat","Soil thermal inertia",ith)
    170172 
    171173  ! Close file
    172   call close_restartphy
     174  call close_restartphy(nid_restart)
    173175 
    174176end subroutine physdem0
     
    217219 
    218220  ! Open file
    219   call open_restartphy(filename)
     221  call open_restartphy(filename,nid_restart)
    220222
    221223  ! First variable to write must be "Time", in order to correctly
     
    224226 
    225227  ! Surface temperature
    226   call put_field("tsurf","Surface temperature",tsurf)
     228  call put_field(nid_restart,"tsurf","Surface temperature",tsurf)
    227229 
    228230  ! Soil temperature
    229   call put_field("tsoil","Soil temperature",tsoil)
     231  call put_field(nid_restart,"tsoil","Soil temperature",tsoil)
    230232 
    231233  ! Emissivity of the surface
    232   call put_field("emis","Surface emissivity",emis)
     234  call put_field(nid_restart,"emis","Surface emissivity",emis)
    233235 
    234236  ! Surface albedo (assume homegeneous spectral albedo for now)
    235   call put_field("albedo","Surface albedo",albedo(:,1))
     237  call put_field(nid_restart,"albedo","Surface albedo",albedo(:,1))
    236238 
    237239  ! Planetary Boundary Layer
    238   call put_field("q2","pbl wind variance",q2)
     240  call put_field(nid_restart,"q2","pbl wind variance",q2)
    239241 
    240242! cloud fraction and sea ice (NB: these should be optional... to be improved)
    241   call put_field("cloudfrac","Cloud fraction",cloudfrac)
    242   call put_field("totcloudfrac","Total fraction",totcloudfrac)
    243   call put_field("hice","Height of oceanic ice",hice)
     243  call put_field(nid_restart,"cloudfrac","Cloud fraction",cloudfrac)
     244  call put_field(nid_restart,"totcloudfrac","Total fraction",totcloudfrac)
     245  call put_field(nid_restart,"hice","Height of oceanic ice",hice)
    244246
    245247 !Slab ocean
    246248 if(ok_slab_ocean) then
    247    call put_field("rnat","Nature of surface",rnat)
    248    call put_field("pctsrf_sic","Pourcentage sea ice",pctsrf_sic)
    249    call put_field("tslab","Temperature slab ocean",tslab)
    250    call put_field("tsea_ice","Temperature of top layer (seaice or snow)",tsea_ice)
    251    call put_field("tice","Temperature of seaice",tice)
    252    call put_field("sea_ice","Sea ice mass",sea_ice)
     249   call put_field(nid_restart,"rnat","Nature of surface",rnat)
     250   call put_field(nid_restart,"pctsrf_sic","Pourcentage sea ice",pctsrf_sic)
     251   call put_field(nid_restart,"tslab","Temperature slab ocean",tslab)
     252   call put_field(nid_restart,"tsea_ice","Temperature of top layer (seaice or snow)",tsea_ice)
     253   call put_field(nid_restart,"tice","Temperature of seaice",tice)
     254   call put_field(nid_restart,"sea_ice","Sea ice mass",sea_ice)
    253255 endif!(ok_slab_ocean)
    254256
     
    256258  if (nq>0) then
    257259    do iq=1,nq
    258       call put_field(noms(iq),"tracer on surface",qsurf(:,iq))
     260      call put_field(nid_restart,noms(iq),"tracer on surface",qsurf(:,iq))
    259261    enddo
    260262  endif ! of if (nq>0)
     
    262264! Non-orographic gavity waves
    263265if (calllott_nonoro) then
    264    call put_field("du_nonoro_gwd","Zonal wind tendency due to GW",du_nonoro_gwd)
    265    call put_field("dv_nonoro_gwd","Meridional wind tendency due to GW",dv_nonoro_gwd)
    266    call put_field("east_gwstress","Eastward stress profile due to GW",east_gwstress)
    267    call put_field("west_gwstress","Westward stress profile due to GW",west_gwstress)
     266   call put_field(nid_restart,"du_nonoro_gwd","Zonal wind tendency due to GW",du_nonoro_gwd)
     267   call put_field(nid_restart,"dv_nonoro_gwd","Meridional wind tendency due to GW",dv_nonoro_gwd)
     268   call put_field(nid_restart,"east_gwstress","Eastward stress profile due to GW",east_gwstress)
     269   call put_field(nid_restart,"west_gwstress","Westward stress profile due to GW",west_gwstress)
    268270endif
    269271
    270272! close file
    271       CALL close_restartphy
     273      CALL close_restartphy(nid_restart)
    272274!$OMP BARRIER
    273275
Note: See TracChangeset for help on using the changeset viewer.