Changeset 2567 for trunk/LMDZ.MARS/util/solzenangle.F90
- Timestamp:
- Oct 5, 2021, 8:34:09 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/solzenangle.F90
r2434 r2567 17 17 character (len=30), dimension(16) :: notprocessed 18 18 ! notprocessed(): names of the (16) variables that won't be processed 19 character (len= 50), dimension(:), allocatable :: var19 character (len=100), dimension(:), allocatable :: var 20 20 ! var(): name(s) of variable(s) that will be processed 21 21 character (len=100) :: tmpvar,long_name,units … … 141 141 if (len_trim(file).eq.0) then 142 142 write(*,*) "no file... game over" 143 stop ""143 stop 144 144 endif 145 145 … … 152 152 write(*,*) 'ERROR: Pb opening file '//trim(file) 153 153 write(*,*) NF_STRERROR(ierr) 154 stop ""154 stop 155 155 endif 156 156 … … 160 160 write(*,*) 'ERROR: Pb with NF_INQ_NVARS' 161 161 write(*,*) NF_STRERROR(ierr) 162 stop ""162 stop 163 163 endif 164 164 … … 218 218 write(*,*) "(an empty line , i.e: just <Enter>, implies end of list)" 219 219 nbvar=0 220 read(*,'(a 50)') tmpvar220 read(*,'(a100)') tmpvar 221 221 do while ((tmpvar/=' ').AND.(trim(tmpvar)/='all')) 222 222 nbvar=nbvar+1 223 223 var(nbvar)=tmpvar 224 read(*,'(a 50)') tmpvar224 read(*,'(a100)') tmpvar 225 225 enddo 226 226 … … 238 238 else if(nbvar==0) then 239 239 write(*,*) "no variable... game over" 240 stop ""240 stop 241 241 endif ! of if (tmpvar=="all") 242 242 … … 252 252 write(*,*) 'ERROR: Pb opening file '//trim(file) 253 253 write(*,*) NF_STRERROR(ierr) 254 stop ""254 stop 255 255 endif 256 256 … … 262 262 if (ierr.NE.NF_NOERR) then 263 263 write(*,*) 'ERROR: Dimension <latitude> is missing in file '//trim(file) 264 stop ""264 stop 265 265 endif 266 266 ierr=NF_INQ_VARID(nid,"latitude",latvar) 267 267 if (ierr.NE.NF_NOERR) then 268 268 write(*,*) 'ERROR: Field <latitude> is missing in file '//trim(file) 269 stop ""269 stop 270 270 endif 271 271 ierr=NF_INQ_DIMLEN(nid,latdim,latlen) … … 275 275 if (ierr.NE.NF_NOERR) then 276 276 write(*,*) 'ERROR: Dimension <longitude> is missing in file '//trim(file) 277 stop ""277 stop 278 278 endif 279 279 ierr=NF_INQ_VARID(nid,"longitude",lonvar) 280 280 if (ierr.NE.NF_NOERR) then 281 281 write(*,*) 'ERROR: Field <longitude> is missing in file'//trim(file) 282 stop ""282 stop 283 283 endif 284 284 ierr=NF_INQ_DIMLEN(nid,londim,lonlen) … … 288 288 if (ierr.NE.NF_NOERR) then 289 289 write(*,*) 'ERROR: Dimension <altitude> is missing in file '//trim(file) 290 stop ""290 stop 291 291 endif 292 292 ierr=NF_INQ_VARID(nid,"altitude",altvar) 293 293 if (ierr.NE.NF_NOERR) then 294 294 write(*,*) 'ERROR: Field <altitude> is missing in file'//trim(file) 295 stop ""295 stop 296 296 endif 297 297 ierr=NF_INQ_DIMLEN(nid,altdim,altlen) … … 315 315 write(*,*) ' Dimension <index> is missing in file '//trim(file) 316 316 ctllen=0 317 !stop ""317 !stop 318 318 endif 319 319 ierr=NF_INQ_VARID(nid,"controle",ctlvar) … … 321 321 write(*,*) 'Field <controle> is missing in file '//trim(file) 322 322 ctllen=0 323 !stop ""323 !stop 324 324 else 325 325 ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen) … … 401 401 if (ierr.NE.NF_NOERR) then 402 402 write(*,*) 'ERROR: Dimension <Time> is missing in file'//trim(file) 403 stop ""403 stop 404 404 endif 405 405 ierr=NF_INQ_VARID(nid,"Time",timevar) 406 406 if (ierr.NE.NF_NOERR) then 407 407 write(*,*) 'ERROR: Field <Time> is missing in file'//trim(file) 408 stop ""408 stop 409 409 endif 410 410 ierr=NF_INQ_DIMLEN(nid,timedim,timelen) … … 583 583 584 584 do it=1,nsol 585 ierr= NF_PUT_VARA_REAL(nout,timevarout, it,1,intsol(it)*24.)585 ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),intsol(it)*24.) 586 586 enddo 587 587 else 588 588 do it=1,nsol 589 ierr= NF_PUT_VARA_REAL(nout,timevarout, it,1,intsol(it))589 ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),intsol(it)) 590 590 if (ierr.NE.NF_NOERR) then 591 591 write(*,*) "Error , failed to write Time" … … 609 609 if (ierr.NE.NF_NOERR) then 610 610 write(*,*) 'ERROR: Field <',var(j),'> not found in file'//file 611 stop ""611 stop 612 612 endif 613 613 ierr=nf_inq_varndims(nid,varid,ndim) … … 768 768 if (ierr.ne.NF_NOERR) then 769 769 write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr) 770 stop ""770 stop 771 771 endif 772 772 … … 814 814 if (ierr.ne.NF_NOERR) then 815 815 write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr) 816 stop ""816 stop 817 817 endif 818 818 … … 929 929 WRITE(*,*)'ERROR: Impossible to create the file ',trim(filename) 930 930 write(*,*) NF_STRERROR(ierr) 931 stop ""931 stop 932 932 endif 933 933 … … 940 940 WRITE(*,*)'initiate: error failed to define dimension <latitude>' 941 941 write(*,*) NF_STRERROR(ierr) 942 stop ""942 stop 943 943 endif 944 944 ierr = NF_DEF_DIM(nout, "longitude", lonlen, londimout) … … 946 946 WRITE(*,*)'initiate: error failed to define dimension <longitude>' 947 947 write(*,*) NF_STRERROR(ierr) 948 stop ""948 stop 949 949 endif 950 950 ierr = NF_DEF_DIM(nout, "altitude", altlen, altdimout) … … 952 952 WRITE(*,*)'initiate: error failed to define dimension <altitude>' 953 953 write(*,*) NF_STRERROR(ierr) 954 stop ""954 stop 955 955 endif 956 956 if (size(ctl).ne.0) then … … 959 959 WRITE(*,*)'initiate: error failed to define dimension <index>' 960 960 write(*,*) NF_STRERROR(ierr) 961 stop ""961 stop 962 962 endif 963 963 endif … … 966 966 WRITE(*,*)'initiate: error failed to define dimension <Time>' 967 967 write(*,*) NF_STRERROR(ierr) 968 stop ""968 stop 969 969 endif 970 970 … … 973 973 WRITE(*,*)'initiate: error failed to define dimension <GCM_layers>' 974 974 write(*,*) NF_STRERROR(ierr) 975 stop ""975 stop 976 976 endif 977 977 … … 981 981 WRITE(*,*)'initiate: error failed to switch out of define mode' 982 982 write(*,*) NF_STRERROR(ierr) 983 stop ""983 stop 984 984 endif 985 985 !============================================================================== … … 992 992 ierr = NF_REDEF (nout) 993 993 ierr = NF_PUT_ATT_TEXT(nout,timevarout,'comment',135,& 994 "The true unit of the variable Time is the integer value &995 994 "The true unit of the variable Time is the integer value "//& 995 "of sol at lon=0deg. A false unit is put to enable reading from Grads or Ferret") 996 996 ! End netcdf define mode 997 997 ierr = NF_ENDDEF(nout) … … 1008 1008 WRITE(*,*)'initiate: error failed writing variable <latitude>' 1009 1009 write(*,*) NF_STRERROR(ierr) 1010 stop ""1010 stop 1011 1011 endif 1012 1012 … … 1022 1022 WRITE(*,*)'initiate: error failed writing variable <longitude>' 1023 1023 write(*,*) NF_STRERROR(ierr) 1024 stop ""1024 stop 1025 1025 endif 1026 1026 … … 1045 1045 WRITE(*,*)'initiate: error failed writing variable <altitude>' 1046 1046 write(*,*) NF_STRERROR(ierr) 1047 stop ""1047 stop 1048 1048 endif 1049 1049 … … 1067 1067 WRITE(*,*)'initiate: error failed writing variable <controle>' 1068 1068 write(*,*) NF_STRERROR(ierr) 1069 stop ""1069 stop 1070 1070 endif 1071 1071 endif … … 1134 1134 hybrid=.true. 1135 1135 if (ierr.ne.NF_NOERR) then 1136 stop "init2 Error: Failed reading aps" 1136 write(*,*) "init2 Error: Failed reading aps" 1137 stop 1137 1138 endif 1138 1139 … … 1151 1152 ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps) 1152 1153 if (ierr.ne.NF_NOERR) then 1153 stop "init2 Error: Failed reading bps" 1154 write(*,*) "init2 Error: Failed reading bps" 1155 stop 1154 1156 endif 1155 1157 endif … … 1170 1172 ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit) 1171 1173 if (ierr.ne.NF_NOERR) then 1172 stop "init2 Error: Failed reading phisinit" 1174 write(*,*) "init2 Error: Failed reading phisinit" 1175 stop 1173 1176 endif 1174 1177 phis = .true. … … 1189 1192 (/layerdimout/),apsid,ierr) 1190 1193 if (ierr.ne.NF_NOERR) then 1191 stop "Error: Failed to def_var aps" 1194 write(*,*) "Error: Failed to def_var aps" 1195 stop 1192 1196 endif 1193 1197 … … 1195 1199 ierr=NF_PUT_VAR_REAL(outfid,apsid,aps) 1196 1200 if (ierr.ne.NF_NOERR) then 1197 stop "Error: Failed to write aps" 1201 write(*,*) "Error: Failed to write aps" 1202 stop 1198 1203 endif 1199 1204 … … 1202 1207 (/layerdimout/),bpsid,ierr) 1203 1208 if (ierr.ne.NF_NOERR) then 1204 stop "Error: Failed to def_var bps" 1209 write(*,*) "Error: Failed to def_var bps" 1210 stop 1205 1211 endif 1206 1212 … … 1208 1214 ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps) 1209 1215 if (ierr.ne.NF_NOERR) then 1210 stop "Error: Failed to write bps" 1216 write(*,*) "Error: Failed to write bps" 1217 stop 1211 1218 endif 1212 1219 … … 1225 1232 (/londimout,latdimout/),phisinitid,ierr) 1226 1233 if (ierr.ne.NF_NOERR) then 1227 stop "Error: Failed to def_var phisinit" 1234 write(*,*) "Error: Failed to def_var phisinit" 1235 stop 1228 1236 endif 1229 1237 … … 1231 1239 ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit) 1232 1240 if (ierr.ne.NF_NOERR) then 1233 stop "Error: Failed to write phisinit" 1241 write(*,*) "Error: Failed to write phisinit" 1242 stop 1234 1243 endif 1235 1244 … … 1347 1356 !write(*,*) 'NF_NOERR', NF_NOERR 1348 1357 !CALL abort 1349 stop ""1358 stop 1350 1359 endif 1351 1360 endif … … 1360 1369 ! WRITE(*,*) 'NF_NOERR', NF_NOERR 1361 1370 ! CALL abort 1362 stop ""1371 stop 1363 1372 endif 1364 1373 endif
Note: See TracChangeset
for help on using the changeset viewer.