Changeset 2567 for trunk/LMDZ.MARS/util/localtime.F90
- Timestamp:
- Oct 5, 2021, 8:34:09 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/localtime.F90
r2546 r2567 12 12 include "netcdf.inc" ! NetCDF definitions 13 13 14 character (len= 50) file14 character (len=100) file 15 15 ! file(): input file(s) names(s) 16 16 character (len=30), dimension(16) :: notprocessed 17 17 ! notprocessed(): names of the (16) variables that won't be processed 18 character (len= 50), dimension(:), allocatable :: var18 character (len=100), dimension(:), allocatable :: var 19 19 ! var(): name(s) of variable(s) that will be processed 20 20 character (len=100) :: tmpvar,long_name,units … … 121 121 if (len_trim(file).eq.0) then 122 122 write(*,*) "no file... game over" 123 stop ""123 stop 124 124 endif 125 125 … … 132 132 write(*,*) 'ERROR: Pb opening file '//trim(file) 133 133 write(*,*) NF_STRERROR(ierr) 134 stop ""134 stop 135 135 endif 136 136 … … 140 140 write(*,*) 'ERROR: Pb with NF_INQ_NVARS' 141 141 write(*,*) NF_STRERROR(ierr) 142 stop ""142 stop 143 143 endif 144 144 … … 199 199 write(*,*) "(an empty line , i.e: just <Enter>, implies end of list)" 200 200 nbvar=0 201 read(*,'(a 50)') tmpvar201 read(*,'(a100)') tmpvar 202 202 do while ((tmpvar/=' ').AND.(trim(tmpvar)/='all')) 203 203 nbvar=nbvar+1 204 204 var(nbvar)=tmpvar 205 read(*,'(a 50)') tmpvar205 read(*,'(a100)') tmpvar 206 206 enddo 207 207 … … 219 219 else if(nbvar==0) then 220 220 write(*,*) "no variable... game over" 221 stop ""221 stop 222 222 endif ! of if (tmpvar=="all") 223 223 … … 238 238 write(*,*) 'ERROR: Pb opening file '//trim(file) 239 239 write(*,*) NF_STRERROR(ierr) 240 stop ""240 stop 241 241 endif 242 242 … … 251 251 if (ierr.NE.NF_NOERR) then 252 252 write(*,*) 'ERROR: Dimension <latitude> and <lat> is missing in file '//trim(file) 253 stop ""253 stop 254 254 endif 255 255 endif … … 260 260 if (ierr.NE.NF_NOERR) then 261 261 write(*,*) 'ERROR: Field <latitude> and <lat> is missing in file '//trim(file) 262 stop ""262 stop 263 263 endif 264 264 endif … … 272 272 if (ierr.NE.NF_NOERR) then 273 273 write(*,*) 'ERROR: Dimension <longitude> and <lon> is missing in file '//trim(file) 274 stop ""274 stop 275 275 endif 276 276 endif … … 281 281 if (ierr.NE.NF_NOERR) then 282 282 write(*,*) 'ERROR: Field <longitude> and <lon> is missing in file '//trim(file) 283 stop ""283 stop 284 284 endif 285 285 endif … … 290 290 if (ierr.NE.NF_NOERR) then 291 291 write(*,*) 'ERROR: Dimension <altitude> is missing in file '//trim(file) 292 stop ""292 stop 293 293 endif 294 294 ierr=NF_INQ_VARID(nid,"altitude",altvar) 295 295 if (ierr.NE.NF_NOERR) then 296 296 write(*,*) 'ERROR: Field <altitude> is missing in file '//trim(file) 297 stop ""297 stop 298 298 endif 299 299 ierr=NF_INQ_DIMLEN(nid,altdim,altlen) … … 321 321 ctllen=0 322 322 endif 323 !stop ""323 !stop 324 324 endif 325 325 ! ierr=NF_INQ_DIMID(nid,"controle_axe",ctldim) 326 326 ! if (ierr.NE.NF_NOERR) then 327 ! !stop ""327 ! !stop 328 328 ! endif 329 329 ierr=NF_INQ_VARID(nid,"controle",ctlvar) … … 331 331 write(*,*) 'Field <controle> is missing in file '//trim(file) 332 332 ctllen=0 333 !stop ""333 !stop 334 334 else 335 335 ierr=NF_INQ_DIMLEN(nid,ctldim,ctllen) … … 414 414 if (ierr.NE.NF_NOERR) then 415 415 write(*,*) 'ERROR: Dimension <Time> or is missing in file'//trim(file) 416 stop ""416 stop 417 417 endif 418 418 endif … … 423 423 if (ierr.NE.NF_NOERR) then 424 424 write(*,*) 'ERROR: Field <Time> is missing in file '//trim(file) 425 stop ""425 stop 426 426 endif 427 427 endif … … 556 556 557 557 do it=1,timelen_lt 558 ierr= NF_PUT_VARA_REAL(nout,timevarout, it,1,lt_hour(it))558 ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),lt_hour(it)) 559 559 enddo 560 560 else 561 561 do it=1,timelen_lt 562 ierr= NF_PUT_VARA_REAL(nout,timevarout, it,1,lt_out(it))562 ierr= NF_PUT_VARA_REAL(nout,timevarout,(/it/),(/1/),lt_out(it)) 563 563 if (ierr.NE.NF_NOERR) then 564 564 write(*,*) "Error , failed to write Time" … … 582 582 if (ierr.NE.NF_NOERR) then 583 583 write(*,*) 'ERROR: Field <',var(j),'> not found in file'//file 584 stop ""584 stop 585 585 endif 586 586 ierr=nf_inq_varndims(nid,varid,ndim) … … 718 718 if (ierr.ne.NF_NOERR) then 719 719 write(*,*) 'PUT_VAR ERROR: ',NF_STRERROR(ierr) 720 stop ""720 stop 721 721 endif 722 722 … … 820 820 WRITE(*,*)'ERROR: Impossible to create the file ',trim(filename) 821 821 write(*,*) NF_STRERROR(ierr) 822 stop ""822 stop 823 823 endif 824 824 … … 831 831 WRITE(*,*)'initiate: error failed to define dimension <latitude>' 832 832 write(*,*) NF_STRERROR(ierr) 833 stop ""833 stop 834 834 endif 835 835 ierr = NF_DEF_DIM(nout, "longitude", lonlen, londimout) … … 837 837 WRITE(*,*)'initiate: error failed to define dimension <longitude>' 838 838 write(*,*) NF_STRERROR(ierr) 839 stop ""839 stop 840 840 endif 841 841 ierr = NF_DEF_DIM(nout, "altitude", altlen, altdimout) … … 843 843 WRITE(*,*)'initiate: error failed to define dimension <altitude>' 844 844 write(*,*) NF_STRERROR(ierr) 845 stop ""845 stop 846 846 endif 847 847 if (size(ctl).ne.0) then … … 850 850 WRITE(*,*)'initiate: error failed to define dimension <index>' 851 851 write(*,*) NF_STRERROR(ierr) 852 stop ""852 stop 853 853 endif 854 854 endif … … 857 857 WRITE(*,*)'initiate: error failed to define dimension <Time>' 858 858 write(*,*) NF_STRERROR(ierr) 859 stop ""859 stop 860 860 endif 861 861 … … 867 867 WRITE(*,*)'initiate: error failed to switch out of define mode' 868 868 write(*,*) NF_STRERROR(ierr) 869 stop ""869 stop 870 870 endif 871 871 … … 888 888 WRITE(*,*)'initiate: error failed writing variable <latitude>' 889 889 write(*,*) NF_STRERROR(ierr) 890 stop ""890 stop 891 891 endif 892 892 … … 903 903 WRITE(*,*)'initiate: error failed writing variable <longitude>' 904 904 write(*,*) NF_STRERROR(ierr) 905 stop ""905 stop 906 906 endif 907 907 … … 926 926 WRITE(*,*)'initiate: error failed writing variable <altitude>' 927 927 write(*,*) NF_STRERROR(ierr) 928 stop ""928 stop 929 929 endif 930 930 … … 948 948 WRITE(*,*)'initiate: error failed writing variable <controle>' 949 949 write(*,*) NF_STRERROR(ierr) 950 stop ""950 stop 951 951 endif 952 952 endif … … 1014 1014 hybrid=.true. 1015 1015 if (ierr.ne.NF_NOERR) then 1016 stop "init2 Error: Failed reading aps" 1016 write(*,*) "init2 Error: Failed reading aps" 1017 stop 1017 1018 endif 1018 1019 … … 1031 1032 ierr=NF_GET_VAR_REAL(infid,tmpvarid,bps) 1032 1033 if (ierr.ne.NF_NOERR) then 1033 stop "init2 Error: Failed reading bps" 1034 write(*,*) "init2 Error: Failed reading bps" 1035 stop 1034 1036 endif 1035 1037 endif … … 1050 1052 ierr=NF_GET_VAR_REAL(infid,tmpvarid,phisinit) 1051 1053 if (ierr.ne.NF_NOERR) then 1052 stop "init2 Error: Failed reading phisinit" 1054 write(*,*) "init2 Error: Failed reading phisinit" 1055 stop 1053 1056 endif 1054 1057 phis = .true. … … 1069 1072 (/layerdimout/),apsid,ierr) 1070 1073 if (ierr.ne.NF_NOERR) then 1071 stop "Error: Failed to def_var aps" 1074 write(*,*) "Error: Failed to def_var aps" 1075 stop 1072 1076 endif 1073 1077 … … 1075 1079 ierr=NF_PUT_VAR_REAL(outfid,apsid,aps) 1076 1080 if (ierr.ne.NF_NOERR) then 1077 stop "Error: Failed to write aps" 1081 write(*,*) "Error: Failed to write aps" 1082 stop 1078 1083 endif 1079 1084 … … 1082 1087 (/layerdimout/),bpsid,ierr) 1083 1088 if (ierr.ne.NF_NOERR) then 1084 stop "Error: Failed to def_var bps" 1089 write(*,*) "Error: Failed to def_var bps" 1090 stop 1085 1091 endif 1086 1092 … … 1088 1094 ierr=NF_PUT_VAR_REAL(outfid,bpsid,bps) 1089 1095 if (ierr.ne.NF_NOERR) then 1090 stop "Error: Failed to write bps" 1096 write(*,*) "Error: Failed to write bps" 1097 stop 1091 1098 endif 1092 1099 … … 1105 1112 (/londimout,latdimout/),phisinitid,ierr) 1106 1113 if (ierr.ne.NF_NOERR) then 1107 stop "Error: Failed to def_var phisinit" 1114 write(*,*) "Error: Failed to def_var phisinit" 1115 stop 1108 1116 endif 1109 1117 … … 1111 1119 ierr=NF_PUT_VAR_REAL(outfid,phisinitid,phisinit) 1112 1120 if (ierr.ne.NF_NOERR) then 1113 stop "Error: Failed to write phisinit" 1121 write(*,*) "Error: Failed to write phisinit" 1122 stop 1114 1123 endif 1115 1124 … … 1226 1235 !write(*,*) 'NF_NOERR', NF_NOERR 1227 1236 !CALL abort 1228 stop ""1237 stop 1229 1238 endif 1230 1239 endif … … 1238 1247 ! WRITE(*,*) 'NF_NOERR', NF_NOERR 1239 1248 ! CALL abort 1240 stop ""1249 stop 1241 1250 endif 1242 1251 endif
Note: See TracChangeset
for help on using the changeset viewer.