Changeset 5075 for LMDZ6/trunk/libf/phylmd/dyn1d
- Timestamp:
- Jul 19, 2024, 10:05:57 AM (7 months ago)
- Location:
- LMDZ6/trunk/libf/phylmd/dyn1d
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/dyn1d/1DUTILS.h
r4650 r5075 673 673 USE logic_mod, ONLY: fxyhypb, ysinus 674 674 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn 675 USE lmdz_netcdf, ONLY:nf_open,nf_write,nf_noerr 675 676 676 677 IMPLICIT NONE … … 682 683 include "dimensions.h" 683 684 !!#include "control.h" 684 include "netcdf.inc"685 685 686 686 ! Arguments: … … 820 820 USE logic_mod, ONLY: fxyhypb, ysinus 821 821 USE temps_mod, ONLY: annee_ref,day_end,day_ref,itau_dyn,itaufin 822 USE lmdz_netcdf, ONLY:nf_open,nf_write,nf_noerr 822 823 823 824 IMPLICIT NONE … … 829 830 include "dimensions.h" 830 831 !!#include "control.h" 831 include "netcdf.inc"832 832 833 833 ! Arguments: -
LMDZ6/trunk/libf/phylmd/dyn1d/1D_decl_cases.h
r4593 r5075 1 INCLUDE "netcdf.inc"2 1 3 2 ! Declarations specifiques au cas Toga -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_amma_read.F90
r5073 r5075 1 1 MODULE mod_1D_amma_read 2 2 USE lmdz_netcdf, ONLY: nf90_get_var,nf_open,nf_noerr,nf_open,nf_nowrite,& 3 nf_inq_dimid,nf_inq_dimlen,nf_strerror,nf_inq_varid 3 4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4 5 !Declarations specifiques au cas AMMA … … 6 7 ! Option du cas AMMA ou on impose la discretisation verticale (Ap,Bp) 7 8 integer nlev_amma, nt_amma 8 9 9 10 10 integer year_ini_amma, day_ini_amma, mth_ini_amma … … 58 58 SUBROUTINE read_1D_cases 59 59 implicit none 60 61 INCLUDE "netcdf.inc"62 60 63 61 INTEGER nid,rid,ierr … … 172 170 173 171 174 END MODULE mod_1D_amma_read175 172 !===================================================================== 176 173 subroutine read_amma(nid,nlevel,ntime & … … 180 177 !program reading forcings of the AMMA case study 181 178 implicit none 182 INCLUDE "netcdf.inc"183 179 184 180 integer ntime,nlevel … … 459 455 END 460 456 457 END MODULE mod_1D_amma_read -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read.F90
r5073 r5075 1 !2 ! $Id$3 !4 1 MODULE mod_1D_cases_read 2 USE lmdz_netcdf, ONLY: nf_noerr,nf_strerror,nf_inq_varid,nf_inq_dimlen,nf_inq_dimid,& 3 nf_nowrite,nf_open,nf90_get_var 5 4 6 5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 6 !Declarations specifiques au cas standard 8 7 character*80 :: fich_cas 9 ! Discr?tisation 8 ! Discr?tisation 10 9 integer nlev_cas, nt_cas 11 10 … … 57 56 real, allocatable:: q_prof_cas(:) 58 57 real, allocatable:: u_prof_cas(:) 59 real, allocatable:: v_prof_cas(:) 58 real, allocatable:: v_prof_cas(:) 60 59 61 60 real, allocatable:: vitw_prof_cas(:) … … 82 81 83 82 real lat_prof_cas,sens_prof_cas,ts_prof_cas,ustar_prof_cas 84 83 85 84 86 85 … … 88 87 89 88 SUBROUTINE read_1D_cas 90 implicit none91 92 INCLUDE "netcdf.inc"93 89 94 90 INTEGER nid,rid,ierr … … 137 133 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 138 134 !profils moyens: 139 allocate(plev_cas(nlev_cas,nt_cas)) 135 allocate(plev_cas(nlev_cas,nt_cas)) 140 136 allocate(z_cas(nlev_cas,nt_cas)) 141 137 allocate(t_cas(nlev_cas,nt_cas),q_cas(nlev_cas,nt_cas),rh_cas(nlev_cas,nt_cas)) … … 204 200 !profils environnementaux: 205 201 deallocate(plev_cas) 206 202 207 203 deallocate(z_cas) 208 204 deallocate(t_cas,q_cas,rh_cas) … … 210 206 deallocate(u_cas) 211 207 deallocate(v_cas) 212 208 213 209 !forcing 214 210 deallocate(ht_cas,vt_cas,dt_cas,dtrad_cas) … … 257 253 END SUBROUTINE deallocate_1D_cases 258 254 259 260 END MODULE mod_1D_cases_read 261 !===================================================================== 255 !===================================================================== 262 256 subroutine read_cas(nid,nlevel,ntime & 263 257 & ,zz,pp,temp,qv,rh,theta,rv,u,v,ug,vg,w, & … … 266 260 267 261 !program reading forcing of the case study 268 implicit none269 INCLUDE "netcdf.inc"270 262 271 263 integer ntime,nlevel … … 296 288 integer var3didin(nbvar3d) 297 289 298 ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 290 ierr=NF_INQ_VARID(nid,"zz",var3didin(1)) 299 291 if(ierr/=NF_NOERR) then 300 292 write(*,*) NF_STRERROR(ierr) 301 293 stop 'lev' 302 294 endif 303 304 ierr=NF_INQ_VARID(nid,"pp",var3didin(2)) 295 296 ierr=NF_INQ_VARID(nid,"pp",var3didin(2)) 305 297 if(ierr/=NF_NOERR) then 306 298 write(*,*) NF_STRERROR(ierr) … … 429 421 stop 'advq' 430 422 endif 431 423 432 424 ierr=NF_INQ_VARID(nid,"hq",var3didin(23)) 433 425 if(ierr/=NF_NOERR) then … … 465 457 stop 'advr' 466 458 endif 467 459 468 460 ierr=NF_INQ_VARID(nid,"hr",var3didin(29)) 469 461 if(ierr/=NF_NOERR) then … … 531 523 stop 'q2' 532 524 endif 533 525 534 526 ierr = nf90_get_var(nid,var3didin(1),zz) 535 527 if(ierr/=NF_NOERR) then … … 560 552 endif 561 553 ! write(*,*)'lecture qv ok',qv 562 554 563 555 ierr = nf90_get_var(nid,var3didin(5),rh) 564 556 if(ierr/=NF_NOERR) then … … 807 799 808 800 809 return 801 return 810 802 end subroutine read_cas 811 803 !====================================================================== … … 825 817 & ,hq_prof_cas,vq_prof_cas,lat_prof_cas,sens_prof_cas & 826 818 & ,ustar_prof_cas,uw_prof_cas,vw_prof_cas,q1_prof_cas,q2_prof_cas) 827 819 828 820 829 821 implicit none … … 834 826 ! day: current julian day (e.g. 717538.2) 835 827 ! day1: first day of the simulation 836 ! nt_cas: total nb of data in the forcing 828 ! nt_cas: total nb of data in the forcing 837 829 ! pdt_cas: total time interval (in sec) between 2 forcing data 838 830 !--------------------------------------------------------------------------------------- … … 926 918 it_cas1=INT(timeit/pdt_cas)+1 927 919 IF (it_cas1 == nt_cas) THEN 928 it_cas2=it_cas1 920 it_cas2=it_cas1 929 921 ELSE 930 922 it_cas2=it_cas1 + 1 … … 952 944 953 945 lat_prof_cas = lat_cas(it_cas2) & 954 & -frac*(lat_cas(it_cas2)-lat_cas(it_cas1)) 946 & -frac*(lat_cas(it_cas2)-lat_cas(it_cas1)) 955 947 sens_prof_cas = sens_cas(it_cas2) & 956 948 & -frac*(sens_cas(it_cas2)-sens_cas(it_cas1)) … … 1017 1009 1018 1010 !********************************************************************************************** 1011 END MODULE mod_1D_cases_read -
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 -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
r4706 r5075 3 3 ! 4 4 MODULE mod_1D_cases_read_std 5 USE lmdz_netcdf, ONLY:nf_noerr,nf_inq_varid,nf_inq_dimid,nf_inq_dimlen,nf_open,nf_nowrite,& 6 nf_strerror,nf90_get_var 5 7 6 8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 87 89 !********************************************************************************************** 88 90 SUBROUTINE read_SCM_cas 89 use netcdf, only: nf90_get_var90 91 implicit none 91 92 92 INCLUDE "netcdf.inc"93 93 INCLUDE "date_cas.h" 94 94 … … 101 101 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid) 102 102 print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid 103 if (ierr .NE.NF_NOERR) then103 if (ierr/=NF_NOERR) then 104 104 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 105 105 write(*,*) NF_STRERROR(ierr) … … 108 108 !....................................................................... 109 109 ierr=NF_INQ_DIMID(nid,'lat',rid) 110 IF (ierr .NE.NF_NOERR) THEN110 IF (ierr/=NF_NOERR) THEN 111 111 print*, 'Oh probleme lecture dimension lat' 112 112 ENDIF … … 115 115 !....................................................................... 116 116 ierr=NF_INQ_DIMID(nid,'lon',rid) 117 IF (ierr .NE.NF_NOERR) THEN117 IF (ierr/=NF_NOERR) THEN 118 118 print*, 'Oh probleme lecture dimension lon' 119 119 ENDIF … … 122 122 !....................................................................... 123 123 ierr=NF_INQ_DIMID(nid,'lev',rid) 124 IF (ierr .NE.NF_NOERR) THEN124 IF (ierr/=NF_NOERR) THEN 125 125 print*, 'Oh probleme lecture dimension nlev' 126 126 ENDIF … … 134 134 ierr=NF_INQ_DIMID(nid,'time',rid) 135 135 nt_cas=0 136 IF (ierr .NE.NF_NOERR) THEN136 IF (ierr/=NF_NOERR) THEN 137 137 stop 'Oh probleme lecture dimension time' 138 138 ENDIF … … 329 329 330 330 !program reading forcing of the case study 331 use netcdf, only: nf90_get_var332 331 implicit none 333 INCLUDE "netcdf.inc"334 332 INCLUDE "compar1d.h" 335 333 … … 455 453 ! Reading variables 1D (N+1) vertical variables (nlevelp1,lat,lon) 456 454 !----------------------------------------------------------------------- 457 if(i .LE.4) then455 if(i<=4) then 458 456 ierr = NF90_GET_VAR(nid,var3didin(i),apbp) 459 457 print *,'read_SCM(apbp), on a lu ',i,name_var(i) … … 466 464 ! Reading 1D (N) vertical varialbes (nlevel,lat,lon) 467 465 !----------------------------------------------------------------------- 468 else if(i .gt.4.and.i.LE.12) then466 else if(i>4.and.i<=12) then 469 467 ierr = NF90_GET_VAR(nid,var3didin(i),resul1) 470 468 print *,'read_SCM(resul1), on a lu ',i,name_var(i) … … 479 477 ! TBD : seems to be the same as above. 480 478 !----------------------------------------------------------------------- 481 else if(i .gt.12.and.i.LE.61) then479 else if(i>12.and.i<=61) then 482 480 ierr = NF90_GET_VAR(nid,var3didin(i),resul) 483 481 print *,'read_SCM(resul), on a lu ',i,name_var(i) … … 491 489 ! Reading 1D time variables (time,lat,lon) 492 490 !----------------------------------------------------------------------- 493 else if (i .gt.62.and.i.LE.75) then491 else if (i>62.and.i<=75) then 494 492 ierr = NF90_GET_VAR(nid,var3didin(i),resul2) 495 493 print *,'read_SCM(resul2), on a lu ',i,name_var(i) … … 777 775 778 776 it_cas1=INT(timeit/pdt_cas)+1 779 IF (it_cas1 .EQ.nt_cas) THEN777 IF (it_cas1 == nt_cas) THEN 780 778 it_cas2=it_cas1 781 779 ELSE … … 787 785 ! print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2 788 786 789 if (it_cas1 .gt. nt_cas) then787 if (it_cas1 > nt_cas) then 790 788 write(*,*) 'PB-stop: day, day_ju_ini_cas,it_cas1, it_cas2, timeit: ' & 791 789 ,day,day_ju_ini_cas,it_cas1,it_cas2,timeit … … 794 792 795 793 ! time interpolation: 796 IF (it_cas1 .EQ.it_cas2) THEN794 IF (it_cas1 == it_cas2) THEN 797 795 frac=0. 798 796 ELSE … … 989 987 do l = 1, llm 990 988 991 if (play(l) .ge.plev_prof_cas(nlev_cas)) then989 if (play(l)>=plev_prof_cas(nlev_cas)) then 992 990 993 991 mxcalc=l … … 996 994 k2=0 997 995 998 if (play(l) .le.plev_prof_cas(1)) then996 if (play(l)<=plev_prof_cas(1)) then 999 997 1000 998 do k = 1, nlev_cas-1 1001 if (play(l) .le.plev_prof_cas(k).and. play(l).gt.plev_prof_cas(k+1)) then999 if (play(l)<=plev_prof_cas(k).and. play(l)>plev_prof_cas(k+1)) then 1002 1000 k1=k 1003 1001 k2=k+1 … … 1005 1003 enddo 1006 1004 1007 if (k1 .eq.0 .or. k2.eq.0) then1005 if (k1==0 .or. k2==0) then 1008 1006 write(*,*) 'PB! k1, k2 = ',k1,k2 1009 1007 write(*,*) 'l,play(l) = ',l,play(l)/100 … … 1019 1017 t_mod_cas(l)= t_prof_cas(k2) - frac*(t_prof_cas(k2)-t_prof_cas(k1)) 1020 1018 theta_mod_cas(l)= th_prof_cas(k2) - frac*(th_prof_cas(k2)-th_prof_cas(k1)) 1021 if(theta_mod_cas(l) .NE.0) t_mod_cas(l)= theta_mod_cas(l)*(play(l)/100000.)**(RD/RCPD)1019 if(theta_mod_cas(l)/=0) t_mod_cas(l)= theta_mod_cas(l)*(play(l)/100000.)**(RD/RCPD) 1022 1020 thv_mod_cas(l)= thv_prof_cas(k2) - frac*(thv_prof_cas(k2)-thv_prof_cas(k1)) 1023 1021 thl_mod_cas(l)= thl_prof_cas(k2) - frac*(thl_prof_cas(k2)-thl_prof_cas(k1)) … … 1068 1066 t_mod_cas(l)= frac1*t_prof_cas(k1) - frac2*t_prof_cas(k2) 1069 1067 theta_mod_cas(l)= frac1*th_prof_cas(k1) - frac2*th_prof_cas(k2) 1070 if(theta_mod_cas(l) .NE.0) t_mod_cas(l)= theta_mod_cas(l)*(play(l)/100000.)**(RD/RCPD)1068 if(theta_mod_cas(l)/=0) t_mod_cas(l)= theta_mod_cas(l)*(play(l)/100000.)**(RD/RCPD) 1071 1069 thv_mod_cas(l)= frac1*thv_prof_cas(k1) - frac2*thv_prof_cas(k2) 1072 1070 thl_mod_cas(l)= frac1*thl_prof_cas(k1) - frac2*thl_prof_cas(k2) … … 1165 1163 do l = 1, llm+1 1166 1164 1167 if (plev(l) .ge.plev_prof_cas(nlev_cas)) then1165 if (plev(l)>=plev_prof_cas(nlev_cas)) then 1168 1166 1169 1167 mxcalc=l … … 1171 1169 k2=0 1172 1170 1173 if (plev(l) .le.plev_prof_cas(1)) then1171 if (plev(l)<=plev_prof_cas(1)) then 1174 1172 1175 1173 do k = 1, nlev_cas-1 1176 if (plev(l) .le.plev_prof_cas(k).and. plev(l).gt.plev_prof_cas(k+1)) then1174 if (plev(l)<=plev_prof_cas(k).and. plev(l)>plev_prof_cas(k+1)) then 1177 1175 k1=k 1178 1176 k2=k+1 … … 1180 1178 enddo 1181 1179 1182 if (k1 .eq.0 .or. k2.eq.0) then1180 if (k1==0 .or. k2==0) then 1183 1181 write(*,*) 'PB! k1, k2 = ',k1,k2 1184 1182 write(*,*) 'l,plev(l) = ',l,plev(l)/100 -
LMDZ6/trunk/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
r4593 r5075 146 146 !program reading forcings of the TWP-ICE experiment 147 147 148 use netcdf, only: nf90_get_var 148 use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,& 149 nf_inq_dimid,nf_inq_dimlen 150 149 151 150 152 implicit none 151 152 INCLUDE "netcdf.inc"153 153 154 154 integer ntime,nlevel … … 492 492 subroutine catchaxis(nid,ttm,llm,time,lev,ierr) 493 493 494 use netcdf, only: nf90_get_var 494 use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,& 495 nf_inq_dimid,nf_inq_dimlen 495 496 496 497 implicit none 497 INCLUDE "netcdf.inc"498 498 integer nid,ttm,llm 499 499 real*8 time(ttm) … … 2170 2170 2171 2171 2172 use netcdf, only: nf90_get_var 2172 use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,& 2173 nf_inq_dimid,nf_inq_dimlen 2173 2174 implicit none 2174 2175 INCLUDE "netcdf.inc"2176 2175 2177 2176 integer ntime,nlevel … … 2381 2380 !program reading initial profils and forcings of the Dice case study 2382 2381 2383 use netcdf, only: nf90_get_var 2382 use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,& 2383 nf_inq_dimid,nf_inq_dimlen 2384 2384 2385 2385 implicit none 2386 2386 2387 INCLUDE "netcdf.inc"2388 2387 INCLUDE "YOMCST.h" 2389 2388 … … 2715 2714 !program reading initial profils and forcings of the Gabls4 case study 2716 2715 2717 use netcdf, only: nf90_get_var 2716 use lmdz_netcdf, ONLY: nf_open,nf_nowrite,nf_noerr,nf_strerror,nf_inq_varid,nf90_get_var,& 2717 nf_inq_dimid,nf_inq_dimlen 2718 2718 2719 2719 implicit none 2720 2721 INCLUDE "netcdf.inc"2722 2720 2723 2721 integer ntime,nlevel,nsol -
LMDZ6/trunk/libf/phylmd/dyn1d/old_1D_decl_cases.h
r4593 r5075 1 INCLUDE "netcdf.inc"2 1 3 2 ! Declarations specifiques au cas Toga -
LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90
r4744 r5075 44 44 USE temps_mod, ONLY: annee_ref, calend, day_end, day_ini, day_ref, & 45 45 itau_dyn, itau_phy, start_time, year_len 46 USE phys_cal_mod, ONLY : year_len_phys_cal_mod => year_len 46 USE phys_cal_mod, ONLY : year_len_phys_cal_mod => year_len 47 USE mod_1D_cases_read, ONLY: interp_case_time ! used in included old_1D_read_forc_cases.h 48 47 49 48 50 implicit none … … 366 368 if (forcing_type <=0) THEN 367 369 forcing_les = .true. 368 elseif (forcing_type .eq.1) THEN370 elseif (forcing_type ==1) THEN 369 371 forcing_radconv = .true. 370 elseif (forcing_type .eq.2) THEN372 elseif (forcing_type ==2) THEN 371 373 forcing_toga = .true. 372 elseif (forcing_type .eq.3) THEN374 elseif (forcing_type ==3) THEN 373 375 forcing_GCM2SCM = .true. 374 elseif (forcing_type .eq.4) THEN376 elseif (forcing_type ==4) THEN 375 377 forcing_twpice = .true. 376 elseif (forcing_type .eq.5) THEN378 elseif (forcing_type ==5) THEN 377 379 forcing_rico = .true. 378 elseif (forcing_type .eq.6) THEN380 elseif (forcing_type ==6) THEN 379 381 forcing_amma = .true. 380 elseif (forcing_type .eq.7) THEN382 elseif (forcing_type ==7) THEN 381 383 forcing_dice = .true. 382 elseif (forcing_type .eq.8) THEN384 elseif (forcing_type ==8) THEN 383 385 forcing_gabls4 = .true. 384 elseif (forcing_type .eq.101) THEN ! Cindynamo starts 1-10-2011 0h386 elseif (forcing_type ==101) THEN ! Cindynamo starts 1-10-2011 0h 385 387 forcing_case = .true. 386 388 year_ini_cas=2011 … … 389 391 heure_ini_cas=0. 390 392 pdt_cas=3*3600. ! forcing frequency 391 elseif (forcing_type .eq.102) THEN ! Bomex starts 24-6-1969 0h393 elseif (forcing_type ==102) THEN ! Bomex starts 24-6-1969 0h 392 394 forcing_case = .true. 393 395 year_ini_cas=1969 … … 396 398 heure_ini_cas=0. 397 399 pdt_cas=1800. ! forcing frequency 398 elseif (forcing_type .eq.103) THEN ! Arm_cu starts 21-6-1997 11h30400 elseif (forcing_type ==103) THEN ! Arm_cu starts 21-6-1997 11h30 399 401 forcing_case2 = .true. 400 402 year_ini_cas=1997 … … 403 405 heure_ini_cas=11.5 404 406 pdt_cas=1800. ! forcing frequency 405 elseif (forcing_type .eq.104) THEN ! rico starts 16-12-2004 0h407 elseif (forcing_type ==104) THEN ! rico starts 16-12-2004 0h 406 408 forcing_case2 = .true. 407 409 year_ini_cas=2004 … … 410 412 heure_ini_cas=0. 411 413 pdt_cas=1800. ! forcing frequency 412 elseif (forcing_type .eq.105) THEN ! bomex starts 16-12-2004 0h414 elseif (forcing_type ==105) THEN ! bomex starts 16-12-2004 0h 413 415 forcing_case2 = .true. 414 416 year_ini_cas=1969 … … 417 419 heure_ini_cas=0. 418 420 pdt_cas=1800. ! forcing frequency 419 elseif (forcing_type .eq.106) THEN ! ayotte_24SC starts 6-11-1992 0h421 elseif (forcing_type ==106) THEN ! ayotte_24SC starts 6-11-1992 0h 420 422 forcing_case2 = .true. 421 423 year_ini_cas=1992 … … 424 426 heure_ini_cas=10. 425 427 pdt_cas=86400. ! forcing frequency 426 elseif (forcing_type .eq.113) THEN ! Arm_cu starts 21-6-1997 11h30428 elseif (forcing_type ==113) THEN ! Arm_cu starts 21-6-1997 11h30 427 429 forcing_SCM = .true. 428 430 year_ini_cas=1997 … … 432 434 mth_ini_cas=1 ! pour le moment on compte depuis le debut de l'annee 433 435 call getin('time_ini',heure_ini_cas) 434 elseif (forcing_type .eq.40) THEN436 elseif (forcing_type ==40) THEN 435 437 forcing_GCSSold = .true. 436 elseif (forcing_type .eq.50) THEN438 elseif (forcing_type ==50) THEN 437 439 forcing_fire = .true. 438 elseif (forcing_type .eq.59) THEN440 elseif (forcing_type ==59) THEN 439 441 forcing_sandu = .true. 440 elseif (forcing_type .eq.60) THEN442 elseif (forcing_type ==60) THEN 441 443 forcing_astex = .true. 442 elseif (forcing_type .eq.61) THEN444 elseif (forcing_type ==61) THEN 443 445 forcing_armcu = .true. 444 IF(llm .NE.19.AND.llm.NE.40) stop 'Erreur nombre de niveaux !!'446 IF(llm/=19.AND.llm/=40) stop 'Erreur nombre de niveaux !!' 445 447 else 446 448 write (*,*) 'ERROR : unknown forcing_type ', forcing_type … … 461 463 jcode = iflag_nudge 462 464 do i = 1,nudge_max 463 nudge(i) = mod(jcode,10) .ge.1465 nudge(i) = mod(jcode,10) >= 1 464 466 jcode = jcode/10 465 467 enddo … … 528 530 529 531 ! Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026) 530 IF(forcing_type .EQ.61) fnday=53100./86400.531 IF(forcing_type .EQ.103) fnday=53100./86400.532 IF(forcing_type == 61) fnday=53100./86400. 533 IF(forcing_type == 103) fnday=53100./86400. 532 534 ! Special case for amma which lasts less than one day : 64800s !! (MPL 20120216) 533 IF(forcing_type .EQ.6) fnday=64800./86400.535 IF(forcing_type == 6) fnday=64800./86400. 534 536 ! IF(forcing_type .EQ. 6) fnday=50400./86400. 535 IF(forcing_type .EQ. 8 ) fnday=129600./86400.537 IF(forcing_type == 8 ) fnday=129600./86400. 536 538 annee_ref = anneeref 537 539 mois = 1 … … 544 546 day_end = day_ini + int(fnday) 545 547 546 IF (forcing_type .eq.2) THEN548 IF (forcing_type ==2) THEN 547 549 ! Convert the initial date of Toga-Coare to Julian day 548 550 call ymds2ju & 549 551 & (year_ini_toga,mth_ini_toga,day_ini_toga,heure,day_ju_ini_toga) 550 552 551 ELSEIF (forcing_type .eq.4) THEN553 ELSEIF (forcing_type ==4) THEN 552 554 ! Convert the initial date of TWPICE to Julian day 553 555 call ymds2ju & 554 556 & (year_ini_twpi,mth_ini_twpi,day_ini_twpi,heure_ini_twpi & 555 557 & ,day_ju_ini_twpi) 556 ELSEIF (forcing_type .eq.6) THEN558 ELSEIF (forcing_type ==6) THEN 557 559 ! Convert the initial date of AMMA to Julian day 558 560 call ymds2ju & 559 561 & (year_ini_amma,mth_ini_amma,day_ini_amma,heure_ini_amma & 560 562 & ,day_ju_ini_amma) 561 ELSEIF (forcing_type .eq.7) THEN563 ELSEIF (forcing_type ==7) THEN 562 564 ! Convert the initial date of DICE to Julian day 563 565 call ymds2ju & 564 566 & (year_ini_dice,mth_ini_dice,day_ini_dice,heure_ini_dice & 565 567 & ,day_ju_ini_dice) 566 ELSEIF (forcing_type .eq.8 ) THEN568 ELSEIF (forcing_type ==8 ) THEN 567 569 ! Convert the initial date of GABLS4 to Julian day 568 570 call ymds2ju & 569 571 & (year_ini_gabls4,mth_ini_gabls4,day_ini_gabls4,heure_ini_gabls4 & 570 572 & ,day_ju_ini_gabls4) 571 ELSEIF (forcing_type .gt.100) THEN573 ELSEIF (forcing_type >100) THEN 572 574 ! Convert the initial date to Julian day 573 575 day_ini_cas=day_deb … … 577 579 & ,day_ju_ini_cas) 578 580 print*,'time case 2',day_ini_cas,day_ju_ini_cas 579 ELSEIF (forcing_type .eq.59) THEN581 ELSEIF (forcing_type ==59) THEN 580 582 ! Convert the initial date of Sandu case to Julian day 581 583 call ymds2ju & … … 583 585 & time_ini*3600.,day_ju_ini_sandu) 584 586 585 ELSEIF (forcing_type .eq.60) THEN587 ELSEIF (forcing_type ==60) THEN 586 588 ! Convert the initial date of Astex case to Julian day 587 589 call ymds2ju & … … 589 591 & time_ini*3600.,day_ju_ini_astex) 590 592 591 ELSEIF (forcing_type .eq.61) THEN593 ELSEIF (forcing_type ==61) THEN 592 594 ! Convert the initial date of Arm_cu case to Julian day 593 595 call ymds2ju & … … 596 598 ENDIF 597 599 598 IF (forcing_type .gt.100) THEN600 IF (forcing_type >100) THEN 599 601 daytime = day + heure_ini_cas/24. ! 1st day and initial time of the simulation 600 602 ELSE … … 638 640 call phys_state_var_init(read_climoz) 639 641 640 if (ngrid .ne.klon) then642 if (ngrid/=klon) then 641 643 print*,'stop in inifis' 642 644 print*,'Probleme de dimensions :' … … 702 704 zlay=-rd*300.*log(play/psurf)/rg ! moved after reading profiles 703 705 704 IF (forcing_type .eq.59) THEN706 IF (forcing_type == 59) THEN 705 707 ! pour forcing_sandu, on cherche l'indice le plus proche de 700hpa#3000m 706 708 write(*,*) '***********************' 707 709 do l = 1, llm 708 710 write(*,*) 'l,play(l),presnivs(l): ',l,play(l),presnivs(l) 709 if (trouve_700 .and. play(l) .le.70000) then711 if (trouve_700 .and. play(l)<=70000) then 710 712 llm700=l 711 713 print *,'llm700,play=',llm700,play(l)/100. … … 826 828 print*,'avant phyredem' 827 829 pctsrf(1,:)=0. 828 if (nat_surf .eq.0.) then830 if (nat_surf==0.) then 829 831 pctsrf(1,is_oce)=1. 830 832 pctsrf(1,is_ter)=0. 831 833 pctsrf(1,is_lic)=0. 832 834 pctsrf(1,is_sic)=0. 833 else if (nat_surf .eq. 1) then835 else if (nat_surf == 1) then 834 836 pctsrf(1,is_oce)=0. 835 837 pctsrf(1,is_ter)=1. 836 838 pctsrf(1,is_lic)=0. 837 839 pctsrf(1,is_sic)=0. 838 else if (nat_surf .eq. 2) then840 else if (nat_surf == 2) then 839 841 pctsrf(1,is_oce)=0. 840 842 pctsrf(1,is_ter)=0. 841 843 pctsrf(1,is_lic)=1. 842 844 pctsrf(1,is_sic)=0. 843 else if (nat_surf .eq. 3) then845 else if (nat_surf == 3) then 844 846 pctsrf(1,is_oce)=0. 845 847 pctsrf(1,is_ter)=0. … … 870 872 pbl_tke(:,2,:)=1.e-2 871 873 PRINT *, ' pbl_tke dans lmdz1d ' 872 if (prt_level .ge. 5) then874 if (prt_level >= 5) then 873 875 DO nsrf = 1,4 874 876 PRINT *,'pbl_tke(1,:,',nsrf,') ',pbl_tke(1,:,nsrf) … … 1021 1023 endif 1022 1024 !Al1 ================ end restart ================================= 1023 IF (ecrit_slab_oc .eq.1) then1025 IF (ecrit_slab_oc==1) then 1024 1026 open(97,file='div_slab.dat',STATUS='UNKNOWN') 1025 elseif (ecrit_slab_oc .eq.0) then1027 elseif (ecrit_slab_oc==0) then 1026 1028 open(97,file='div_slab.dat',STATUS='OLD') 1027 1029 endif … … 1046 1048 it_end = nint(fnday*day_step) 1047 1049 !test JLD it_end = 10 1048 do while(it .le.it_end)1049 1050 if (prt_level .ge.1) then1050 do while(it<=it_end) 1051 1052 if (prt_level>=1) then 1051 1053 print*,'XXXXXXXXXXXXXXXXXXX ITAP,day,time=', & 1052 1054 & it,day,time,it_end,day_step … … 1054 1056 endif 1055 1057 !Al1 demande de restartphy.nc 1056 if (it .eq.it_end) lastcall=.True.1058 if (it==it_end) lastcall=.True. 1057 1059 1058 1060 !--------------------------------------------------------------------- … … 1149 1151 1150 1152 if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice & 1151 & .or.forcing_amma .or. forcing_type .eq.101) then1153 & .or.forcing_amma .or. forcing_type==101) then 1152 1154 fcoriolis=0.0 ; ug=0. ; vg=0. 1153 1155 endif … … 1164 1166 !on calcule dt_cooling 1165 1167 do l=1,llm 1166 if (play(l) .ge.20000.) then1168 if (play(l)>=20000.) then 1167 1169 dt_cooling(l)=-1.5/86400. 1168 elseif ((play(l) .ge.10000.).and.((play(l).lt.20000.))) then1170 elseif ((play(l)>=10000.).and.((play(l)<20000.))) then 1169 1171 dt_cooling(l)=-1.5/86400.*(play(l)-10000.)/(10000.)-1./86400.*(20000.-play(l))/10000.*(temp(l)-200.) 1170 1172 else … … 1273 1275 & +d_q_nudge(1:mxcalc,:) ) 1274 1276 1275 if (prt_level .ge.3) then1277 if (prt_level>=3) then 1276 1278 print *, & 1277 1279 & 'physiq-> temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1) ', & … … 1351 1353 1352 1354 !Al1 1353 if (ecrit_slab_oc .ne.-1) close(97)1355 if (ecrit_slab_oc/=-1) close(97) 1354 1356 1355 1357 !Al1 Call to 1D equivalent of dynredem (an,mois,jour,heure ?)
Note: See TracChangeset
for help on using the changeset viewer.