Changeset 3510
- Timestamp:
- Nov 12, 2024, 11:46:59 AM (9 days ago)
- Location:
- trunk/LMDZ.COMMON/libf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem.F90
r3509 r3510 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, put_char1, err, modname, fil 12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil, int2fmtstr 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 INTEGER, PARAMETER :: ndscrpt = 42 47 INTEGER :: ldscrpt 47 48 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 "/) 49 character(ndscrpt), dimension(:), allocatable :: dscrpt_tab_cntrl 77 50 INTEGER :: ierr 78 51 CHARACTER(LEN=80) :: abort_message … … 109 82 start_file_type="planeto" 110 83 idecal = 4 84 ldscrpt = 28 111 85 else 112 86 if ( planet_type.eq."titan" ) then 113 87 ! Titan inherited Earth-like start files with idecal=5 114 88 write(lunout,*) trim(modname),' : Titan start file' 89 ldscrpt = 29 115 90 else 116 91 write(lunout,*) trim(modname),' : Earth-like start file' 92 ldscrpt = 32 117 93 endif 118 94 idecal = 5 … … 120 96 121 97 tab_cntrl(:) = 0. 98 allocate(dscrpt_tab_cntrl(ldscrpt)) 99 dscrpt_tab_cntrl(1:5) = (/ & 100 "(1) Number of nodes along longitude ", & 101 "(2) Number of nodes along latitude ", & 102 "(3) Number of atmospheric layers ", & 103 "(4) Reference day ", & 104 "(5) Reference year "/) 122 105 tab_cntrl(1) = REAL(iim) 123 106 tab_cntrl(2) = REAL(jjm) … … 128 111 !tab_cntrl(4)=REAL(day_end) 129 112 tab_cntrl(4)=REAL(iday_end) 113 dscrpt_tab_cntrl(4) = "(4) Initial day " 130 114 endif 131 115 tab_cntrl(5) = REAL(annee_ref) … … 150 134 tab_cntrl(idecal+17) = grossismx 151 135 tab_cntrl(idecal+18) = grossismy 136 dscrpt_tab_cntrl(idecal + 1:idecal + 18) = (/ & 137 int2fmtstr(idecal + 1)//" Radius of the planet ", & 138 int2fmtstr(idecal + 2)//" Rotation of the planet (rad/s) ", & 139 int2fmtstr(idecal + 3)//" Gravity (m/s2) ", & 140 int2fmtstr(idecal + 4)//" Specific heat Cp (J.kg-1.K-1) ", & 141 int2fmtstr(idecal + 5)//" = r/Cp (=kappa) ", & 142 int2fmtstr(idecal + 6)//" Lenght of a sol (s) ", & 143 int2fmtstr(idecal + 7)//" Dynamical time step (s) ", & 144 int2fmtstr(idecal + 8)//" Total energy ", & 145 int2fmtstr(idecal + 9)//" Total pressure ", & 146 int2fmtstr(idecal + 10)//" Total enstrophy ", & 147 int2fmtstr(idecal + 11)//" Total enthalpy ", & 148 int2fmtstr(idecal + 12)//" Total angular momentum ", & 149 int2fmtstr(idecal + 13)//" Reference pressure (Pa) ", & 150 int2fmtstr(idecal + 14)//" Reference surface pressure (Pa) ", & 151 int2fmtstr(idecal + 15)//" Longitude of center of zoom ", & 152 int2fmtstr(idecal + 16)//" Latitude of center of zoom ", & 153 int2fmtstr(idecal + 17)//" Zooming factor, along longitude ", & 154 int2fmtstr(idecal + 18)//" Zooming factor, along latitude "/) 152 155 ! 153 156 IF ( fxyhypb ) THEN … … 158 161 tab_cntrl(idecal+23) = taux 159 162 tab_cntrl(idecal+24) = tauy 163 dscrpt_tab_cntrl(idecal + 19:idecal + 24) = (/ & 164 int2fmtstr(idecal + 19)//" 1. ", & 165 int2fmtstr(idecal + 20)//" Extention (in longitude) of zoom ", & 166 int2fmtstr(idecal + 21)//" Extention (in latitude) of zoom ", & 167 int2fmtstr(idecal + 22)//" - ", & 168 int2fmtstr(idecal + 23)//" Stiffness factor of zoom in longitude", & 169 int2fmtstr(idecal + 24)//" Stiffness factor of zoom in latitude "/) 160 170 ELSE 161 171 tab_cntrl(idecal+19) = 0. … … 166 176 tab_cntrl(idecal+24) = 0. 167 177 IF( ysinus ) tab_cntrl(idecal+22) = 1. 178 dscrpt_tab_cntrl(idecal + 19:idecal + 24) = (/ & 179 int2fmtstr(idecal + 19)//" - ", & 180 int2fmtstr(idecal + 20)//" Extention (in longitude) of zoom ", & 181 int2fmtstr(idecal + 21)//" Extention (in latitude) of zoom ", & 182 int2fmtstr(idecal + 22)//" 1. ", & 183 int2fmtstr(idecal + 23)//" Stiffness factor of zoom in longitude", & 184 int2fmtstr(idecal + 24)//" Stiffness factor of zoom in latitude "/) 168 185 ENDIF 169 186 … … 173 190 ! start_time: start_time of simulation (not necessarily 0.) 174 191 tab_cntrl(idecal+27) = start_time 192 dscrpt_tab_cntrl(idecal + 25:idecal + 27) = (/ & 193 "(30) Initial day ", & 194 "(31) Extention (in longitude) of zoom ", & 195 "(32) Start time of simulation "/) 175 196 endif 176 197 … … 303 324 WRITE(lunout,*)TRIM(modname)//': iim,jjm,llm,iday_end',iim,jjm,llm,iday_end 304 325 WRITE(lunout,*)TRIM(modname)//': rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa 326 327 deallocate(dscrpt_tab_cntrl) 305 328 306 329 END SUBROUTINE dynredem0 … … 428 451 429 452 END SUBROUTINE dynredem1 430 -
trunk/LMDZ.COMMON/libf/dyn3d_common/dynredem_mod.F90
r3509 r3510 6 6 NF90_DEF_VAR, NF90_CHAR 7 7 PRIVATE 8 PUBLIC :: dynredem_write_u, dynredem_write_v, dynredem_read_u, err 8 PUBLIC :: dynredem_write_u, dynredem_write_v, dynredem_read_u, err, int2fmtstr 9 9 PUBLIC :: cre_var, get_var1, put_var1, put_var2, put_char1, fil, modname, msg 10 10 include "dimensions.h" … … 258 258 !=============================================================================== 259 259 260 261 !=============================================================================== 262 ! 263 FUNCTION int2fmtstr(i) RESULT(fmtstr) 264 ! 265 !=============================================================================== 266 ! Conversion of an integer (0 < i < 100) to the formatted string needed for the 267 ! desccription of the 'controle' array 268 !=============================================================================== 269 ! Arguments: 270 integer, intent(in) :: i !--- Input 271 character(4) :: fmtstr !--- Output 272 !=============================================================================== 273 if (i < 1 .or. i > 99) call ABORT_gcm(modname,'Invalid integer given to int2fmtstr!',1) 274 write(fmtstr,'(i2)') i 275 if (len(trim(adjustl(fmtstr))) > 1) then 276 fmtstr = '('//trim(adjustl(fmtstr))//')' 277 else 278 fmtstr = '('//trim(adjustl(fmtstr))//') ' 279 endif 280 281 END FUNCTION int2fmtstr 282 ! 283 !=============================================================================== 284 260 285 END MODULE dynredem_mod -
trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F90
r3509 r3510 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, put_char1, err, modname, fil 12 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, put_char1, err, modname, fil, int2fmtstr 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 INTEGER, PARAMETER :: ndscrpt = 42 47 INTEGER :: ldscrpt 47 48 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 "/) 49 character(ndscrpt), dimension(:), allocatable :: dscrpt_tab_cntrl 77 50 INTEGER :: ierr 78 51 CHARACTER(LEN=80) :: abort_message … … 110 83 start_file_type="planeto" 111 84 idecal = 4 85 ldscrpt = 28 112 86 else 113 87 if ( planet_type.eq."titan" ) then 114 88 ! Titan inherited Earth-like start files with idecal=5 115 89 write(lunout,*) trim(modname),' : Titan start file' 90 ldscrpt = 29 116 91 else 117 92 write(lunout,*) trim(modname),' : Earth-like start file' 93 ldscrpt = 32 118 94 endif 119 95 idecal = 5 … … 121 97 122 98 tab_cntrl(:) = 0. 99 allocate(dscrpt_tab_cntrl(ldscrpt)) 100 dscrpt_tab_cntrl(1:5) = (/ & 101 "(1) Number of nodes along longitude ", & 102 "(2) Number of nodes along latitude ", & 103 "(3) Number of atmospheric layers ", & 104 "(4) Reference day ", & 105 "(5) Reference year "/) 123 106 tab_cntrl(1) = REAL(iim) 124 107 tab_cntrl(2) = REAL(jjm) … … 129 112 !tab_cntrl(4)=REAL(day_end) 130 113 tab_cntrl(4)=REAL(iday_end) 114 dscrpt_tab_cntrl(4) = "(4) Initial day " 131 115 endif 132 116 tab_cntrl(5) = REAL(annee_ref) … … 151 135 tab_cntrl(idecal+17) = grossismx 152 136 tab_cntrl(idecal+18) = grossismy 137 dscrpt_tab_cntrl(idecal + 1:idecal + 18) = (/ & 138 int2fmtstr(idecal + 1)//" Radius of the planet ", & 139 int2fmtstr(idecal + 2)//" Rotation of the planet (rad/s) ", & 140 int2fmtstr(idecal + 3)//" Gravity (m/s2) ", & 141 int2fmtstr(idecal + 4)//" Specific heat Cp (J.kg-1.K-1) ", & 142 int2fmtstr(idecal + 5)//" = r/Cp (=kappa) ", & 143 int2fmtstr(idecal + 6)//" Lenght of a sol (s) ", & 144 int2fmtstr(idecal + 7)//" Dynamical time step (s) ", & 145 int2fmtstr(idecal + 8)//" Total energy ", & 146 int2fmtstr(idecal + 9)//" Total pressure ", & 147 int2fmtstr(idecal + 10)//" Total enstrophy ", & 148 int2fmtstr(idecal + 11)//" Total enthalpy ", & 149 int2fmtstr(idecal + 12)//" Total angular momentum ", & 150 int2fmtstr(idecal + 13)//" Reference pressure (Pa) ", & 151 int2fmtstr(idecal + 14)//" Reference surface pressure (Pa) ", & 152 int2fmtstr(idecal + 15)//" Longitude of center of zoom ", & 153 int2fmtstr(idecal + 16)//" Latitude of center of zoom ", & 154 int2fmtstr(idecal + 17)//" Zooming factor, along longitude ", & 155 int2fmtstr(idecal + 18)//" Zooming factor, along latitude "/) 153 156 ! 154 157 IF ( fxyhypb ) THEN … … 159 162 tab_cntrl(idecal+23) = taux 160 163 tab_cntrl(idecal+24) = tauy 164 dscrpt_tab_cntrl(idecal + 19:idecal + 24) = (/ & 165 int2fmtstr(idecal + 19)//" 1. ", & 166 int2fmtstr(idecal + 20)//" Extention (in longitude) of zoom ", & 167 int2fmtstr(idecal + 21)//" Extention (in latitude) of zoom ", & 168 int2fmtstr(idecal + 22)//" - ", & 169 int2fmtstr(idecal + 23)//" Stiffness factor of zoom in longitude", & 170 int2fmtstr(idecal + 24)//" Stiffness factor of zoom in latitude "/) 161 171 ELSE 162 172 tab_cntrl(idecal+19) = 0. … … 167 177 tab_cntrl(idecal+24) = 0. 168 178 IF( ysinus ) tab_cntrl(idecal+22) = 1. 179 dscrpt_tab_cntrl(idecal + 19:idecal + 24) = (/ & 180 int2fmtstr(idecal + 19)//" - ", & 181 int2fmtstr(idecal + 20)//" Extention (in longitude) of zoom ", & 182 int2fmtstr(idecal + 21)//" Extention (in latitude) of zoom ", & 183 int2fmtstr(idecal + 22)//" 1. ", & 184 int2fmtstr(idecal + 23)//" Stiffness factor of zoom in longitude", & 185 int2fmtstr(idecal + 24)//" Stiffness factor of zoom in latitude "/) 169 186 ENDIF 170 187 … … 174 191 ! start_time: start_time of simulation (not necessarily 0.) 175 192 tab_cntrl(idecal+27) = start_time 193 dscrpt_tab_cntrl(idecal + 25:idecal + 27) = (/ & 194 "(30) Initial day ", & 195 "(31) Extention (in longitude) of zoom ", & 196 "(32) Start time of simulation "/) 176 197 endif 177 198 … … 304 325 WRITE(lunout,*)TRIM(modname)//': iim,jjm,llm,iday_end',iim,jjm,llm,iday_end 305 326 WRITE(lunout,*)TRIM(modname)//': rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa 327 328 deallocate(dscrpt_tab_cntrl) 306 329 307 330 endif ! of if (mpi_rank==0)
Note: See TracChangeset
for help on using the changeset viewer.