Changeset 5100 for LMDZ6/branches/Amaury_dev/libf/dyn3d
- Timestamp:
- Jul 23, 2024, 7:00:20 AM (6 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/dyn3d
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
r5099 r5100 8 8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 9 9 USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str 10 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_INQ_VARID, &11 NF90_CLOSE, nf90_get_var, nf90_noerr10 USE netcdf, ONLY: nf90_open, nf90_nowrite, NF90_INQ_VARID, & 11 nf90_close, nf90_get_var, nf90_noerr 12 12 USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey 13 13 USE control_mod, ONLY: planet_type … … 50 50 !--- Initial state file opening 51 51 var=fichnom 52 CALL err( NF90_OPEN(var,NF90_NOWRITE,fID),"open",var)52 CALL err(nf90_open(var,nf90_nowrite,fID),"open",var) 53 53 CALL get_var1("controle",tab_cntrl) 54 54 … … 188 188 END DO 189 189 190 CALL err( NF90_CLOSE(fID),"close",fichnom)190 CALL err(nf90_close(fID),"close",fichnom) 191 191 day_ini=day_ini+INT(time) 192 192 time=time-INT(time) -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90
r5099 r5100 9 9 USE strings_mod, ONLY: maxlen 10 10 USE infotrac, ONLY: nqtot, tracers 11 USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL, &12 NF90_CLOSE, NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER, &13 NF90_64BIT_OFFSET11 USE netcdf, ONLY: nf90_create, nf90_def_dim, NF90_INQ_VARID, nf90_global, & 12 nf90_close, nf90_put_att, nf90_unlimited, nf90_clobber, & 13 nf90_64bit_offset 14 14 USE dynredem_mod, ONLY: cre_var, put_var1, put_var2, err, modname, fil 15 15 USE comvert_mod, ONLY: ap, bp, presnivs, pa, preff, nivsig, nivsigs … … 105 105 106 106 !--- File creation 107 CALL err( NF90_CREATE(fichnom,IOR(NF90_CLOBBER,NF90_64BIT_OFFSET),nid))107 CALL err(nf90_create(fichnom,IOR(nf90_clobber,nf90_64bit_offset),nid)) 108 108 109 109 !--- Some global attributes 110 CALL err( NF90_PUT_ATT(nid,NF90_GLOBAL,"title","Fichier demarrage dynamique"))110 CALL err(nf90_put_att(nid,nf90_global,"title","Fichier demarrage dynamique")) 111 111 112 112 !--- Dimensions 113 CALL err( NF90_DEF_DIM(nid,"index", length, indexID))114 CALL err( NF90_DEF_DIM(nid,"rlonu", iip1, rlonuID))115 CALL err( NF90_DEF_DIM(nid,"rlatu", jjp1, rlatuID))116 CALL err( NF90_DEF_DIM(nid,"rlonv", iip1, rlonvID))117 CALL err( NF90_DEF_DIM(nid,"rlatv", jjm, rlatvID))118 CALL err( NF90_DEF_DIM(nid,"sigs", llm, sID))119 CALL err( NF90_DEF_DIM(nid,"sig", llmp1, sigID))120 CALL err( NF90_DEF_DIM(nid,"temps", NF90_UNLIMITED, timID))113 CALL err(nf90_def_dim(nid,"index", length, indexID)) 114 CALL err(nf90_def_dim(nid,"rlonu", iip1, rlonuID)) 115 CALL err(nf90_def_dim(nid,"rlatu", jjp1, rlatuID)) 116 CALL err(nf90_def_dim(nid,"rlonv", iip1, rlonvID)) 117 CALL err(nf90_def_dim(nid,"rlatv", jjm, rlatvID)) 118 CALL err(nf90_def_dim(nid,"sigs", llm, sID)) 119 CALL err(nf90_def_dim(nid,"sig", llmp1, sigID)) 120 CALL err(nf90_def_dim(nid,"temps", nf90_unlimited, timID)) 121 121 122 122 !--- Define and save invariant fields … … 149 149 CALL cre_var(nid,"masse","Masse d air" ,[rlonvID,rlatuID,sID,timID]) 150 150 CALL cre_var(nid,"ps" ,"Pression au sol",[rlonvID,rlatuID ,timID]) 151 CALL err( NF90_CLOSE(nid))151 CALL err(nf90_close (nid)) 152 152 153 153 WRITE(lunout,*)TRIM(modname)//': iim,jjm,llm,iday_end',iim,jjm,llm,iday_end … … 169 169 USE infotrac, ONLY: nqtot, tracers, type_trac 170 170 USE control_mod 171 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, nf90_get_var, NF90_INQ_VARID, &172 NF90_CLOSE, NF90_WRITE, NF90_PUT_VAR, nf90_noerr171 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_get_var, NF90_INQ_VARID, & 172 nf90_close, NF90_WRITE, nf90_put_var, nf90_noerr 173 173 USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, & 174 174 err, modname, fil, msg … … 202 202 203 203 modname='dynredem1'; fil=fichnom 204 CALL err( NF90_OPEN(fil,NF90_WRITE,nid),"open",fil)204 CALL err(nf90_open(fil,NF90_WRITE,nid),"open",fil) 205 205 206 206 !--- Write/extend time coordinate … … 208 208 var="temps" 209 209 CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var) 210 CALL err( NF90_PUT_VAR(nid,vID,[time]),"put",var)210 CALL err(nf90_put_var(nid,vID,[time]),"put",var) 211 211 WRITE(lunout,*)TRIM(modname)//": Saving for ", nb, time 212 212 … … 217 217 tab_cntrl(31)=DBLE(itau_dyn + itaufin) 218 218 CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var) 219 CALL err( NF90_PUT_VAR(nid,vID,tab_cntrl),"put",var)219 CALL err(nf90_put_var(nid,vID,tab_cntrl),"put",var) 220 220 221 221 !--- Save fields … … 229 229 lread_inca=.FALSE.; fil="start_trac.nc" 230 230 IF(ANY(type_trac == ['inca','inco'])) INQUIRE(FILE=fil,EXIST=lread_inca) 231 IF(lread_inca) CALL err( NF90_OPEN(fil,NF90_NOWRITE,nid_trac),"open")231 IF(lread_inca) CALL err(nf90_open(fil,nf90_nowrite,nid_trac),"open") 232 232 233 233 !--- Save tracers … … 245 245 CALL dynredem_write_u(nid,var,q(:,:,:,iq),llm) 246 246 END DO 247 CALL err( NF90_CLOSE(nid),"close")247 CALL err(nf90_close(nid),"close") 248 248 fil="start_trac.nc" 249 IF(lread_inca) CALL err( NF90_CLOSE(nid_trac),"close")249 IF(lread_inca) CALL err(nf90_close(nid_trac),"close") 250 250 251 251 END SUBROUTINE dynredem1 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem_mod.F90
r5099 r5100 32 32 start(:)=[1,1,1,1]; count(:)=[iip1,jjp1,ll,1] 33 33 CALL err(NF90_INQ_VARID(ncid,id,nvarid),"inq",id) 34 CALL err( NF90_PUT_VAR(ncid,nvarid,var,start,count),"put",id)34 CALL err(nf90_put_var(ncid,nvarid,var,start,count),"put",id) 35 35 36 36 END SUBROUTINE dynredem_write_u … … 55 55 start(:)=[1,1,1,1]; count(:)=[iip1,jjm,ll,1] 56 56 CALL err(NF90_INQ_VARID(ncid,id,nvarid),"inq",id) 57 CALL err( NF90_PUT_VAR(ncid,nvarid,var,start,count),"put",id)57 CALL err(nf90_put_var(ncid,nvarid,var,start,count),"put",id) 58 58 59 59 END SUBROUTINE dynredem_write_v … … 96 96 CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: units 97 97 !=============================================================================== 98 CALL err( NF90_DEF_VAR(ncid,var,nf90_format,did,nvarid),"inq",var)99 IF(title/="") CALL err( NF90_PUT_ATT(ncid,nvarid,"title",title),var)100 IF(PRESENT(units)) CALL err( NF90_PUT_ATT(ncid,nvarid,"units",units),var)98 CALL err(nf90_def_var(ncid,var,nf90_format,did,nvarid),"inq",var) 99 IF(title/="") CALL err(nf90_put_att(ncid,nvarid,"title",title),var) 100 IF(PRESENT(units)) CALL err(nf90_put_att(ncid,nvarid,"units",units),var) 101 101 102 102 END SUBROUTINE cre_var … … 119 119 IF( PRESENT(units)) CALL cre_var(ncid,var,title,did,units) 120 120 IF(.NOT.PRESENT(units)) CALL cre_var(ncid,var,title,did) 121 CALL err( NF90_ENDDEF(ncid))122 CALL err( NF90_PUT_VAR(ncid,nvarid,v),"put",var)121 CALL err(nf90_enddef(ncid)) 122 CALL err(nf90_put_var(ncid,nvarid,v),"put",var) 123 123 CALL err(NF90_REDEF(ncid)) 124 124 … … 142 142 IF( PRESENT(units)) CALL cre_var(ncid,var,title,did,units) 143 143 IF(.NOT.PRESENT(units)) CALL cre_var(ncid,var,title,did) 144 CALL err( NF90_ENDDEF(ncid))145 CALL err( NF90_PUT_VAR(ncid,nvarid,v),"put",var)144 CALL err(nf90_enddef(ncid)) 145 CALL err(nf90_put_var(ncid,nvarid,v),"put",var) 146 146 CALL err(NF90_REDEF(ncid)) 147 147 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
r5099 r5100 175 175 if (guide_plevs==1) then 176 176 if (ncidpl==-99) then 177 rcod=nf90_open('apbp.nc', Nf90_NOWRITe, ncidpl)177 rcod=nf90_open('apbp.nc',nf90_nowrite, ncidpl) 178 178 if (rcod/=nf90_noerr) THEN 179 179 abort_message=' Nudging error -> no file apbp.nc' … … 183 183 elseif (guide_plevs==2) then 184 184 if (ncidpl==-99) then 185 rcod=nf90_open('P.nc', Nf90_NOWRITe,ncidpl)185 rcod=nf90_open('P.nc',nf90_nowrite,ncidpl) 186 186 if (rcod/=nf90_noerr) THEN 187 187 abort_message=' Nudging error -> no file P.nc' … … 192 192 elseif (guide_u) then 193 193 if (ncidpl==-99) then 194 rcod=nf90_open('u.nc', Nf90_NOWRITe,ncidpl)194 rcod=nf90_open('u.nc',nf90_nowrite,ncidpl) 195 195 if (rcod/=nf90_noerr) THEN 196 196 CALL abort_gcm(modname, & … … 1690 1690 1691 1691 ! Creation des variables dimensions 1692 ierr= NF90_DEF_VAR(nid,"LONU",NF90_FLOAT,id_lonu,vid_lonu)1693 ierr= NF90_DEF_VAR(nid,"LONV",NF90_FLOAT,id_lonv,vid_lonv)1694 ierr= NF90_DEF_VAR(nid,"LATU",NF90_FLOAT,id_latu,vid_latu)1695 ierr= NF90_DEF_VAR(nid,"LATV",NF90_FLOAT,id_latv,vid_latv)1696 ierr= NF90_DEF_VAR(nid,"LEVEL",NF90_FLOAT,id_lev,vid_lev)1697 ierr= NF90_DEF_VAR(nid,"cu",NF90_FLOAT,(/id_lonu,id_latu/),vid_cu)1698 ierr= NF90_DEF_VAR(nid,"cv",NF90_FLOAT,(/id_lonv,id_latv/),vid_cv)1699 ierr= NF90_DEF_VAR(nid,"au",NF90_FLOAT,(/id_lonu,id_latu/),vid_au)1700 ierr= NF90_DEF_VAR(nid,"av",NF90_FLOAT,(/id_lonv,id_latv/),vid_av)1692 ierr=nf90_def_var(nid,"LONU",nf90_float,id_lonu,vid_lonu) 1693 ierr=nf90_def_var(nid,"LONV",nf90_float,id_lonv,vid_lonv) 1694 ierr=nf90_def_var(nid,"LATU",nf90_float,id_latu,vid_latu) 1695 ierr=nf90_def_var(nid,"LATV",nf90_float,id_latv,vid_latv) 1696 ierr=nf90_def_var(nid,"LEVEL",nf90_float,id_lev,vid_lev) 1697 ierr=nf90_def_var(nid,"cu",nf90_float,(/id_lonu,id_latu/),vid_cu) 1698 ierr=nf90_def_var(nid,"cv",nf90_float,(/id_lonv,id_latv/),vid_cv) 1699 ierr=nf90_def_var(nid,"au",nf90_float,(/id_lonu,id_latu/),vid_au) 1700 ierr=nf90_def_var(nid,"av",nf90_float,(/id_lonv,id_latv/),vid_av) 1701 1701 call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), & 1702 1702 varid_alpha_t) … … 1724 1724 ! Pressure (GCM) 1725 1725 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 1726 ierr = NF90_DEF_VAR(nid,"SP",NF90_FLOAT,dim4,varid)1726 ierr = nf90_def_var(nid,"SP",nf90_float,dim4,varid) 1727 1727 ! Surface pressure (guidage) 1728 1728 IF (guide_P) THEN 1729 1729 dim3=(/id_lonv,id_latu,id_tim/) 1730 ierr = NF90_DEF_VAR(nid,"ps",NF90_FLOAT,dim3,varid)1730 ierr = nf90_def_var(nid,"ps",nf90_float,dim3,varid) 1731 1731 ENDIF 1732 1732 ! Zonal wind 1733 1733 IF (guide_u) THEN 1734 1734 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 1735 ierr = NF90_DEF_VAR(nid,"u",NF90_FLOAT,dim4,varid)1736 ierr = NF90_DEF_VAR(nid,"ua",NF90_FLOAT,dim4,varid)1737 ierr = NF90_DEF_VAR(nid,"ucov",NF90_FLOAT,dim4,varid)1735 ierr = nf90_def_var(nid,"u",nf90_float,dim4,varid) 1736 ierr = nf90_def_var(nid,"ua",nf90_float,dim4,varid) 1737 ierr = nf90_def_var(nid,"ucov",nf90_float,dim4,varid) 1738 1738 ENDIF 1739 1739 ! Merid. wind 1740 1740 IF (guide_v) THEN 1741 1741 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 1742 ierr = NF90_DEF_VAR(nid,"v",NF90_FLOAT,dim4,varid)1743 ierr = NF90_DEF_VAR(nid,"va",NF90_FLOAT,dim4,varid)1744 ierr = NF90_DEF_VAR(nid,"vcov",NF90_FLOAT,dim4,varid)1742 ierr = nf90_def_var(nid,"v",nf90_float,dim4,varid) 1743 ierr = nf90_def_var(nid,"va",nf90_float,dim4,varid) 1744 ierr = nf90_def_var(nid,"vcov",nf90_float,dim4,varid) 1745 1745 ENDIF 1746 1746 ! Pot. Temperature 1747 1747 IF (guide_T) THEN 1748 1748 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 1749 ierr = NF90_DEF_VAR(nid,"teta",NF90_FLOAT,dim4,varid)1749 ierr = nf90_def_var(nid,"teta",nf90_float,dim4,varid) 1750 1750 ENDIF 1751 1751 ! Specific Humidity 1752 1752 IF (guide_Q) THEN 1753 1753 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 1754 ierr = NF90_DEF_VAR(nid,"q",NF90_FLOAT,dim4,varid)1754 ierr = nf90_def_var(nid,"q",nf90_float,dim4,varid) 1755 1755 ENDIF 1756 1756 -
LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90
r5099 r5100 22 22 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 23 23 USE readTracFiles_mod, ONLY: addPhase 24 use netcdf, only : NF90_NOWRITE,NF90_OPEN,nf90_noerr,NF90_INQ_VARID,NF90_CLOSE,nf90_get_var24 use netcdf, only : nf90_nowrite,nf90_open,nf90_noerr,NF90_INQ_VARID,nf90_close,nf90_get_var 25 25 26 26 ! Author: Frederic Hourdin original: 15/01/93 … … 140 140 141 141 relief=0. 142 ierr = NF90_OPEN ('relief_in.nc', NF90_NOWRITE,nid_relief)142 ierr = nf90_open ('relief_in.nc', nf90_nowrite,nid_relief) 143 143 if (ierr==nf90_noerr) THEN 144 144 ierr=NF90_INQ_VARID(nid_relief,'RELIEF',varid) … … 150 150 endif 151 151 endif 152 ierr = NF90_CLOSE(nid_relief)152 ierr = nf90_close (nid_relief) 153 153 154 154 !------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.