Changeset 5075 for LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
- Timestamp:
- Jul 19, 2024, 10:05:57 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
r4706 r5075 3 3 ! 4 4 MODULE mod_1D_cases_read2 5 5 USE lmdz_netcdf, ONLY: nf90_get_var,nf_noerr,nf_inq_varid,nf_inq_dimlen,nf_strerror,nf_open,& 6 nf_nowrite,nf_inq_dimid 6 7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 8 !Declarations specifiques au cas standard … … 81 82 implicit none 82 83 83 INCLUDE "netcdf.inc"84 85 84 INTEGER nid,rid,ierr 86 85 INTEGER ii,jj … … 90 89 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid) 91 90 print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid 92 if (ierr .NE.NF_NOERR) then91 if (ierr/=NF_NOERR) then 93 92 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 94 93 write(*,*) NF_STRERROR(ierr) … … 97 96 !....................................................................... 98 97 ierr=NF_INQ_DIMID(nid,'lat',rid) 99 IF (ierr .NE.NF_NOERR) THEN98 IF (ierr/=NF_NOERR) THEN 100 99 print*, 'Oh probleme lecture dimension lat' 101 100 ENDIF … … 104 103 !....................................................................... 105 104 ierr=NF_INQ_DIMID(nid,'lon',rid) 106 IF (ierr .NE.NF_NOERR) THEN105 IF (ierr/=NF_NOERR) THEN 107 106 print*, 'Oh probleme lecture dimension lon' 108 107 ENDIF … … 111 110 !....................................................................... 112 111 ierr=NF_INQ_DIMID(nid,'lev',rid) 113 IF (ierr .NE.NF_NOERR) THEN112 IF (ierr/=NF_NOERR) THEN 114 113 print*, 'Oh probleme lecture dimension zz' 115 114 ENDIF … … 120 119 print*,'nid,rid',nid,rid 121 120 nt_cas=0 122 IF (ierr .NE.NF_NOERR) THEN121 IF (ierr/=NF_NOERR) THEN 123 122 stop 'probleme lecture dimension sens' 124 123 ENDIF … … 192 191 implicit none 193 192 194 INCLUDE "netcdf.inc"195 196 193 INTEGER nid,rid,ierr 197 194 INTEGER ii,jj … … 201 198 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid) 202 199 print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid 203 if (ierr .NE.NF_NOERR) then200 if (ierr/=NF_NOERR) then 204 201 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 205 202 write(*,*) NF_STRERROR(ierr) … … 208 205 !....................................................................... 209 206 ierr=NF_INQ_DIMID(nid,'lat',rid) 210 IF (ierr .NE.NF_NOERR) THEN207 IF (ierr/=NF_NOERR) THEN 211 208 print*, 'Oh probleme lecture dimension lat' 212 209 ENDIF … … 215 212 !....................................................................... 216 213 ierr=NF_INQ_DIMID(nid,'lon',rid) 217 IF (ierr .NE.NF_NOERR) THEN214 IF (ierr/=NF_NOERR) THEN 218 215 print*, 'Oh probleme lecture dimension lon' 219 216 ENDIF … … 222 219 !....................................................................... 223 220 ierr=NF_INQ_DIMID(nid,'nlev',rid) 224 IF (ierr .NE.NF_NOERR) THEN221 IF (ierr/=NF_NOERR) THEN 225 222 print*, 'Oh probleme lecture dimension nlev' 226 223 ENDIF … … 230 227 ierr=NF_INQ_DIMID(nid,'time',rid) 231 228 nt_cas=0 232 IF (ierr .NE.NF_NOERR) THEN229 IF (ierr/=NF_NOERR) THEN 233 230 stop 'Oh probleme lecture dimension time' 234 231 ENDIF … … 317 314 !********************************************************************************************** 318 315 SUBROUTINE old_read_SCM_cas 319 use netcdf, only: nf90_get_var320 316 implicit none 321 317 322 INCLUDE "netcdf.inc"323 318 INCLUDE "date_cas.h" 324 319 … … 331 326 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid) 332 327 print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid 333 if (ierr .NE.NF_NOERR) then328 if (ierr/=NF_NOERR) then 334 329 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 335 330 write(*,*) NF_STRERROR(ierr) … … 338 333 !....................................................................... 339 334 ierr=NF_INQ_DIMID(nid,'lat',rid) 340 IF (ierr .NE.NF_NOERR) THEN335 IF (ierr/=NF_NOERR) THEN 341 336 print*, 'Oh probleme lecture dimension lat' 342 337 ENDIF … … 345 340 !....................................................................... 346 341 ierr=NF_INQ_DIMID(nid,'lon',rid) 347 IF (ierr .NE.NF_NOERR) THEN342 IF (ierr/=NF_NOERR) THEN 348 343 print*, 'Oh probleme lecture dimension lon' 349 344 ENDIF … … 352 347 !....................................................................... 353 348 ierr=NF_INQ_DIMID(nid,'lev',rid) 354 IF (ierr .NE.NF_NOERR) THEN349 IF (ierr/=NF_NOERR) THEN 355 350 print*, 'Oh probleme lecture dimension nlev' 356 351 ENDIF … … 364 359 ierr=NF_INQ_DIMID(nid,'time',rid) 365 360 nt_cas=0 366 IF (ierr .NE.NF_NOERR) THEN361 IF (ierr/=NF_NOERR) THEN 367 362 stop 'Oh probleme lecture dimension time' 368 363 ENDIF … … 533 528 534 529 535 END MODULE mod_1D_cases_read2536 530 !===================================================================== 537 531 subroutine read_cas2(nid,nlevel,ntime & … … 541 535 542 536 !program reading forcing of the case study 543 use netcdf, only: nf90_get_var544 537 implicit none 545 INCLUDE "netcdf.inc"546 538 547 539 integer ntime,nlevel … … 589 581 do i=1,nbvar3d 590 582 print *,'Dans read_cas2, on va lire ',var3didin(i),name_var(i) 591 if(i .LE.35) then583 if(i<=35) then 592 584 ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime]) 593 585 print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i) … … 658 650 659 651 !program reading forcing of the case study 660 use netcdf, only: nf90_get_var661 652 implicit none 662 INCLUDE "netcdf.inc"663 653 664 654 integer ntime,nlevel … … 711 701 else 712 702 !----------------------------------------------------------------------- 713 if(i .LE.4) then ! Lecture des coord pression en (nlevelp1,lat,lon)703 if(i<=4) then ! Lecture des coord pression en (nlevelp1,lat,lon) 714 704 ierr = NF90_GET_VAR(nid,var3didin(i),apbp, count = [1, 1, nlevel + 1]) 715 705 print *,'read2_cas(apbp), on a lu ',i,name_var(i) … … 719 709 endif 720 710 !----------------------------------------------------------------------- 721 else if(i .gt.4.and.i.LE.45) then ! Lecture des variables en (time,nlevel,lat,lon)711 else if(i>4.and.i<=45) then ! Lecture des variables en (time,nlevel,lat,lon) 722 712 ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime]) 723 713 print *,'read2_cas(resul), on a lu ',i,name_var(i) … … 727 717 endif 728 718 !----------------------------------------------------------------------- 729 else if (i .gt.45.and.i.LE.51) then ! Lecture des variables en (time,lat,lon)719 else if (i>45.and.i<=51) then ! Lecture des variables en (time,lat,lon) 730 720 ierr = NF90_GET_VAR(nid,var3didin(i),resul2, count = [1, 1, ntime]) 731 721 print *,'read2_cas(resul2), on a lu ',i,name_var(i) … … 829 819 830 820 !program reading forcing of the case study 831 use netcdf, only: nf90_get_var832 821 implicit none 833 INCLUDE "netcdf.inc"834 822 835 823 integer ntime,nlevel,k,t … … 888 876 else 889 877 !----------------------------------------------------------------------- 890 if(i .LE.4) then ! Lecture des coord pression en (nlevelp1,lat,lon)878 if(i<=4) then ! Lecture des coord pression en (nlevelp1,lat,lon) 891 879 ierr = NF90_GET_VAR(nid,var3didin(i),apbp) 892 880 print *,'read2_cas(apbp), on a lu ',i,name_var(i) … … 896 884 endif 897 885 !----------------------------------------------------------------------- 898 else if(i .gt.4.and.i.LE.12) then ! Lecture des variables en (time,nlevel,lat,lon)886 else if(i>4.and.i<=12) then ! Lecture des variables en (time,nlevel,lat,lon) 899 887 ierr = NF90_GET_VAR(nid,var3didin(i),resul1) 900 888 print *,'read2_cas(resul1), on a lu ',i,name_var(i) … … 905 893 print*,'Lecture de la variable #i ',i,name_var(i),minval(resul1),maxval(resul1) 906 894 !----------------------------------------------------------------------- 907 else if(i .gt.12.and.i.LE.54) then ! Lecture des variables en (time,nlevel,lat,lon)895 else if(i>12.and.i<=54) then ! Lecture des variables en (time,nlevel,lat,lon) 908 896 ierr = NF90_GET_VAR(nid,var3didin(i),resul) 909 897 print *,'read2_cas(resul), on a lu ',i,name_var(i) … … 914 902 print*,'Lecture de la variable #i ',i,name_var(i),minval(resul),maxval(resul) 915 903 !----------------------------------------------------------------------- 916 else if (i .gt.54.and.i.LE.65) then ! Lecture des variables en (time,lat,lon)904 else if (i>54.and.i<=65) then ! Lecture des variables en (time,lat,lon) 917 905 ierr = NF90_GET_VAR(nid,var3didin(i),resul2) 918 906 print *,'read2_cas(resul2), on a lu ',i,name_var(i) … … 1148 1136 1149 1137 it_cas1=INT(timeit/pdt_cas)+1 1150 IF (it_cas1 .EQ.nt_cas) THEN1138 IF (it_cas1 == nt_cas) THEN 1151 1139 it_cas2=it_cas1 1152 1140 ELSE … … 1157 1145 !print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2 1158 1146 1159 if (it_cas1 .gt.nt_cas) then1147 if (it_cas1 > nt_cas) then 1160 1148 write(*,*) 'PB-stop: day, day_ju_ini_cas,it_cas1, it_cas2, timeit: ' & 1161 1149 ,day,day_ju_ini_cas,it_cas1,it_cas2,timeit … … 1164 1152 1165 1153 ! time interpolation: 1166 IF (it_cas1 .EQ.it_cas2) THEN1154 IF (it_cas1 == it_cas2) THEN 1167 1155 frac=0. 1168 1156 ELSE … … 1363 1351 1364 1352 it_cas1=INT(timeit/pdt_cas)+1 1365 IF (it_cas1 .EQ.nt_cas) THEN1353 IF (it_cas1 == nt_cas) THEN 1366 1354 it_cas2=it_cas1 1367 1355 ELSE … … 1373 1361 !print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2 1374 1362 1375 if (it_cas1 .gt. nt_cas) then1363 if (it_cas1 > nt_cas) then 1376 1364 write(*,*) 'PB-stop: day, day_ju_ini_cas,it_cas1, it_cas2, timeit: ' & 1377 1365 ,day,day_ju_ini_cas,it_cas1,it_cas2,timeit … … 1380 1368 1381 1369 ! time interpolation: 1382 IF (it_cas1 .EQ.it_cas2) THEN1370 IF (it_cas1 == it_cas2) THEN 1383 1371 frac=0. 1384 1372 ELSE … … 1475 1463 !********************************************************************************************** 1476 1464 1465 END MODULE mod_1D_cases_read2
Note: See TracChangeset
for help on using the changeset viewer.