Changeset 3509 for trunk/LMDZ.COMMON
- Timestamp:
- Nov 8, 2024, 4:59:55 PM (2 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem.F90
r2507 r3509 8 8 #endif 9 9 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, & 11 11 NF90_CLOSE, NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER 12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, err, modname, fil12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil 13 13 use netcdf95, only: NF95_PUT_VAR 14 14 use control_mod, only : planet_type … … 44 44 INTEGER :: iq,l 45 45 INTEGER, PARAMETER :: length=100 46 INTEGER, PARAMETER :: ldscrpt = 28, ndscrpt = 42 46 47 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 "/) 47 77 INTEGER :: ierr 48 78 CHARACTER(LEN=80) :: abort_message … … 50 80 ! For NetCDF: 51 81 CHARACTER(LEN=30) :: unites 52 INTEGER :: indexID 82 INTEGER :: indexID, descrptID, dscrpt_sID 53 83 INTEGER :: rlonuID, rlonvID, rlatuID, rlatvID 54 84 INTEGER :: sID, sigID, nID, vID, timID … … 166 196 CALL err(NF90_DEF_DIM(nid,"sig", llmp1, sigID)) 167 197 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)) 168 200 else 169 201 CALL err(NF90_DEF_DIM(nid,"index", length, indexID)) … … 175 207 CALL err(NF90_DEF_DIM(nid,"interlayer", llmp1, sigID)) 176 208 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)) 177 211 endif 178 212 179 213 !--- 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) 181 216 CALL put_var1(nid,"rlonu" ,"Longitudes des points U",[rlonuID],rlonu) 182 217 CALL put_var1(nid,"rlatu" ,"Latitudes des points U" ,[rlatuID],rlatu) -
trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem_mod.F90
r1824 r3509 4 4 NF90_REDEF, NF90_ENDDEF, NF90_PUT_VAR, & 5 5 NF90_PUT_ATT, NF90_GET_VAR, NF90_INQ_VARID, & 6 NF90_DEF_VAR 6 NF90_DEF_VAR, NF90_CHAR 7 7 PRIVATE 8 8 PUBLIC :: dynredem_write_u, dynredem_write_v, dynredem_read_u, err 9 PUBLIC :: cre_var, get_var1, put_var1, put_var2, fil, modname, msg9 PUBLIC :: cre_var, get_var1, put_var1, put_var2, put_char1, fil, modname, msg 10 10 include "dimensions.h" 11 11 include "paramet.h" … … 184 184 !=============================================================================== 185 185 ! 186 SUBROUTINE 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 205 END SUBROUTINE put_char1 206 ! 207 !=============================================================================== 208 209 210 !=============================================================================== 211 ! 186 212 FUNCTION msg(typ,nam) 187 213 ! -
trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F90
r2507 r3509 10 10 USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL, & 11 11 NF90_CLOSE, NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER 12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, err, modname, fil12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil 13 13 use netcdf95, only: NF95_PUT_VAR 14 14 use control_mod, only : planet_type … … 44 44 INTEGER :: iq,l 45 45 INTEGER, PARAMETER :: length=100 46 INTEGER, PARAMETER :: ldscrpt = 28, ndscrpt = 42 46 47 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 "/) 47 77 INTEGER :: ierr 48 78 CHARACTER(LEN=80) :: abort_message … … 50 80 ! For NetCDF: 51 81 CHARACTER(LEN=30) :: unites 52 INTEGER :: indexID 82 INTEGER :: indexID, descrptID, dscrpt_sID 53 83 INTEGER :: rlonuID, rlonvID, rlatuID, rlatvID 54 84 INTEGER :: sID, sigID, nID, vID, timID … … 167 197 CALL err(NF90_DEF_DIM(nid,"sig", llmp1, sigID)) 168 198 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)) 169 201 else 170 202 CALL err(NF90_DEF_DIM(nid,"index", length, indexID)) … … 176 208 CALL err(NF90_DEF_DIM(nid,"interlayer", llmp1, sigID)) 177 209 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)) 178 212 endif 179 213 180 214 !--- Define and save invariant fields 181 215 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) 182 217 CALL put_var1(nid,"rlonu" ,"Longitudes des points U",[rlonuID],rlonu) 183 218 CALL put_var1(nid,"rlatu" ,"Latitudes des points U" ,[rlatuID],rlatu)
Note: See TracChangeset
for help on using the changeset viewer.