Changeset 3509 for trunk/LMDZ.COMMON


Ignore:
Timestamp:
Nov 8, 2024, 4:59:55 PM (2 weeks ago)
Author:
jbclement
Message:

Dynamic + Mars PCM:
Addition of the description for the 'controle' array in the "start.nc" and "startfi.nc" files. It is given by the variable 'controle_descriptor' whose the element 'controle_descriptor(i)' explains 'controle(i)'.
JBC

Location:
trunk/LMDZ.COMMON/libf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem.F90

    r2507 r3509  
    88#endif
    99  USE infotrac, ONLY: nqtot, tname, ttext
    10   USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL,    &
     10  USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL, &
    1111                    NF90_CLOSE,  NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER
    12   USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, err, modname, fil
     12  USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil
    1313  use netcdf95, only: NF95_PUT_VAR
    1414  use control_mod, only : planet_type
     
    4444  INTEGER :: iq,l
    4545  INTEGER, PARAMETER :: length=100
     46  INTEGER, PARAMETER :: ldscrpt = 28, ndscrpt = 42
    4647  REAL :: tab_cntrl(length) ! run parameters
     48  character(ndscrpt), dimension(ldscrpt), parameter :: dscrpt_tab_cntrl = (/ &
     49      "(1)  Number of nodes along longitude      ", &
     50      "(2)  Number of nodes along latitude       ", &
     51      "(3)  Number of atmospheric layers         ", &
     52      "(4)  Initial day                          ", &
     53      "(5)  Radius of the planet                 ", &
     54      "(6)  Rotation of the planet (rad/s)       ", &
     55      "(7)  Gravity (m/s2)                       ", &
     56      "(8)  Specific heat Cp (J.kg-1.K-1)        ", &
     57      "(9)  = r/Cp (=kappa)                      ", &
     58      "(10) Lenght of a sol (s)                  ", &
     59      "(11) Dynamical time step (s)              ", &
     60      "(12) Total energy                         ", &
     61      "(13) Total pressure                       ", &
     62      "(14) Total enstrophy                      ", &
     63      "(15) Total enthalpy                       ", &
     64      "(16) Total angular momentum               ", &
     65      "(17) Reference pressure (Pa)              ", &
     66      "(18) Reference surface pressure (Pa)      ", &
     67      "(19) Longitude of center of zoom          ", &
     68      "(20) Latitude of center of zoom           ", &
     69      "(21) Zooming factor, along longitude      ", &
     70      "(22) Zooming factor, along latitude       ", &
     71      "(23) -                                    ", &
     72      "(24) Extention (in longitude) of zoom     ", &
     73      "(25) Extention (in latitude) of zoom      ", &
     74      "(26) -                                    ", &
     75      "(27) Stiffness factor of zoom in longitude", &
     76      "(28) Stiffness factor of zoom in latitude "/)
    4777  INTEGER :: ierr
    4878  CHARACTER(LEN=80) :: abort_message
     
    5080!   For NetCDF:
    5181  CHARACTER(LEN=30) :: unites
    52   INTEGER :: indexID
     82  INTEGER :: indexID, descrptID, dscrpt_sID
    5383  INTEGER :: rlonuID, rlonvID, rlatuID, rlatvID
    5484  INTEGER :: sID, sigID, nID, vID, timID
     
    166196    CALL err(NF90_DEF_DIM(nid,"sig",   llmp1,    sigID))
    167197    CALL err(NF90_DEF_DIM(nid,"temps", NF90_UNLIMITED, timID))
     198    CALL err(NF90_DEF_DIM(nid,"descriptor", ldscrpt, descrptID))
     199    CALL err(NF90_DEF_DIM(nid,"description_size", ndscrpt, dscrpt_sID))
    168200  else
    169201    CALL err(NF90_DEF_DIM(nid,"index", length, indexID))
     
    175207    CALL err(NF90_DEF_DIM(nid,"interlayer",   llmp1,    sigID))
    176208    CALL err(NF90_DEF_DIM(nid,"Time", NF90_UNLIMITED, timID))
     209    CALL err(NF90_DEF_DIM(nid,"descriptor", ldscrpt, descrptID))
     210    CALL err(NF90_DEF_DIM(nid,"description_size", ndscrpt, dscrpt_sID))
    177211  endif
    178212
    179213!--- Define and save invariant fields
    180   CALL put_var1(nid,"controle","Parametres de controle" ,[indexID],tab_cntrl)
     214  CALL put_var1(nid,"controle","Parametres de controle",[indexID],tab_cntrl)
     215  CALL put_char1(nid,"controle_descriptor","Description of control parameters",[dscrpt_sID,descrptID],dscrpt_tab_cntrl)
    181216  CALL put_var1(nid,"rlonu"   ,"Longitudes des points U",[rlonuID],rlonu)
    182217  CALL put_var1(nid,"rlatu"   ,"Latitudes des points U" ,[rlatuID],rlatu)
  • trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem_mod.F90

    r1824 r3509  
    44                    NF90_REDEF, NF90_ENDDEF, NF90_PUT_VAR, &
    55                    NF90_PUT_ATT, NF90_GET_VAR, NF90_INQ_VARID, &
    6                     NF90_DEF_VAR
     6                    NF90_DEF_VAR, NF90_CHAR
    77  PRIVATE
    88  PUBLIC :: dynredem_write_u, dynredem_write_v, dynredem_read_u, err
    9   PUBLIC :: cre_var, get_var1, put_var1, put_var2, fil, modname, msg
     9  PUBLIC :: cre_var, get_var1, put_var1, put_var2, put_char1, fil, modname, msg
    1010  include "dimensions.h"
    1111  include "paramet.h"
     
    184184!===============================================================================
    185185!
     186SUBROUTINE put_char1(ncid,var,title,did,v,units)
     187!
     188!===============================================================================
     189  IMPLICIT NONE
     190!===============================================================================
     191! Arguments:
     192  INTEGER,                    INTENT(IN) :: ncid
     193  CHARACTER(LEN=*),           INTENT(IN) :: var, title
     194  INTEGER,                    INTENT(IN) :: did(2)
     195  CHARACTER(*),               INTENT(IN) :: v(:)
     196  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: units
     197!===============================================================================
     198  CALL err(NF90_DEF_VAR(ncid,var,NF90_CHAR,did,nvarid),"inq",var)
     199  IF(title/="")      CALL err(NF90_PUT_ATT(ncid,nvarid,"title",title),var)
     200  IF(PRESENT(units)) CALL err(NF90_PUT_ATT(ncid,nvarid,"units",units),var)
     201  CALL err(NF90_ENDDEF(ncid))
     202  CALL err(NF90_PUT_VAR(ncid,nvarid,v),"put",var)
     203  CALL err(NF90_REDEF(ncid))
     204
     205END SUBROUTINE put_char1
     206!
     207!===============================================================================
     208
     209
     210!===============================================================================
     211!
    186212FUNCTION msg(typ,nam)
    187213!
  • trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F90

    r2507 r3509  
    1010  USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL,    &
    1111                    NF90_CLOSE,  NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER
    12   USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, err, modname, fil
     12  USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil
    1313  use netcdf95, only: NF95_PUT_VAR
    1414  use control_mod, only : planet_type
     
    4444  INTEGER :: iq,l
    4545  INTEGER, PARAMETER :: length=100
     46  INTEGER, PARAMETER :: ldscrpt = 28, ndscrpt = 42
    4647  REAL :: tab_cntrl(length) ! run parameters
     48  character(ndscrpt), dimension(ldscrpt), parameter :: dscrpt_tab_cntrl = (/ &
     49      "(1)  Number of nodes along longitude      ", &
     50      "(2)  Number of nodes along latitude       ", &
     51      "(3)  Number of atmospheric layers         ", &
     52      "(4)  Initial day                          ", &
     53      "(5)  Radius of the planet                 ", &
     54      "(6)  Rotation of the planet (rad/s)       ", &
     55      "(7)  Gravity (m/s2)                       ", &
     56      "(8)  Specific heat Cp (J.kg-1.K-1)        ", &
     57      "(9)  = r/Cp (=kappa)                      ", &
     58      "(10) Lenght of a sol (s)                  ", &
     59      "(11) Dynamical time step (s)              ", &
     60      "(12) Total energy                         ", &
     61      "(13) Total pressure                       ", &
     62      "(14) Total enstrophy                      ", &
     63      "(15) Total enthalpy                       ", &
     64      "(16) Total angular momentum               ", &
     65      "(17) Reference pressure (Pa)              ", &
     66      "(18) Reference surface pressure (Pa)      ", &
     67      "(19) Longitude of center of zoom          ", &
     68      "(20) Latitude of center of zoom           ", &
     69      "(21) Zooming factor, along longitude      ", &
     70      "(22) Zooming factor, along latitude       ", &
     71      "(23) -                                    ", &
     72      "(24) Extention (in longitude) of zoom     ", &
     73      "(25) Extention (in latitude) of zoom      ", &
     74      "(26) -                                    ", &
     75      "(27) Stiffness factor of zoom in longitude", &
     76      "(28) Stiffness factor of zoom in latitude "/)
    4777  INTEGER :: ierr
    4878  CHARACTER(LEN=80) :: abort_message
     
    5080!   For NetCDF:
    5181  CHARACTER(LEN=30) :: unites
    52   INTEGER :: indexID
     82  INTEGER :: indexID, descrptID, dscrpt_sID
    5383  INTEGER :: rlonuID, rlonvID, rlatuID, rlatvID
    5484  INTEGER :: sID, sigID, nID, vID, timID
     
    167197    CALL err(NF90_DEF_DIM(nid,"sig",   llmp1,    sigID))
    168198    CALL err(NF90_DEF_DIM(nid,"temps", NF90_UNLIMITED, timID))
     199    CALL err(NF90_DEF_DIM(nid,"descriptor", ldscrpt, descrptID))
     200    CALL err(NF90_DEF_DIM(nid,"description_size", ndscrpt, dscrpt_sID))
    169201  else
    170202    CALL err(NF90_DEF_DIM(nid,"index", length, indexID))
     
    176208    CALL err(NF90_DEF_DIM(nid,"interlayer",   llmp1,    sigID))
    177209    CALL err(NF90_DEF_DIM(nid,"Time", NF90_UNLIMITED, timID))
     210    CALL err(NF90_DEF_DIM(nid,"descriptor", ldscrpt, descrptID))
     211    CALL err(NF90_DEF_DIM(nid,"description_size", ndscrpt, dscrpt_sID))
    178212  endif
    179213
    180214!--- Define and save invariant fields
    181215  CALL put_var1(nid,"controle","Parametres de controle" ,[indexID],tab_cntrl)
     216  CALL put_char1(nid,"controle_descriptor","Description of control parameters",[dscrpt_sID,descrptID],dscrpt_tab_cntrl)
    182217  CALL put_var1(nid,"rlonu"   ,"Longitudes des points U",[rlonuID],rlonu)
    183218  CALL put_var1(nid,"rlatu"   ,"Latitudes des points U" ,[rlatuID],rlatu)
Note: See TracChangeset for help on using the changeset viewer.