- Timestamp:
- Oct 24, 2024, 1:55:38 PM (4 weeks ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/guide_mod.f90
r5268 r5270 14 14 nf90_inq_dimid, nf90_inquire_dimension 15 15 use pres2lev_mod, only: pres2lev 16 USE netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, & 17 nf90_inq_dimid, nf90_inquire_dimension, nf90_float, nf90_def_var, & 18 nf90_create, nf90_def_dim, nf90_open, nf90_unlimited, nf90_write, nf90_enddef, nf90_redef, & 19 nf90_close, nf90_inq_varid, nf90_get_var, nf90_noerr, nf90_clobber, & 20 nf90_64bit_offset, nf90_inq_dimid, nf90_inquire_dimension, nf90_put_var 16 21 17 22 IMPLICIT NONE … … 77 82 INCLUDE "dimensions.h" 78 83 INCLUDE "paramet.h" 79 INCLUDE "netcdf.inc"80 84 81 85 INTEGER :: error,ncidpl,rid,rcod … … 224 228 225 229 endif 226 error= NF_INQ_DIMID(ncidpl,'LEVEL',rid)227 IF (error.NE.NF90_NOERR) error= NF_INQ_DIMID(ncidpl,'PRESSURE',rid)230 error=nf90_inq_dimid(ncidpl,'LEVEL',rid) 231 IF (error.NE.NF90_NOERR) error=nf90_inq_dimid(ncidpl,'PRESSURE',rid) 228 232 IF (error.NE.NF90_NOERR) THEN 229 233 CALL abort_gcm(modname,'Nudging: error reading pressure levels',1) 230 234 ENDIF 231 error= NF_INQ_DIMLEN(ncidpl,rid,nlevnc)235 error=nf90_inquire_dimension(ncidpl,rid,len=nlevnc) 232 236 write(*,*)trim(modname)//' : number of vertical levels nlevnc', nlevnc 233 237 rcod = nf90_close(ncidpl) … … 1660 1664 INCLUDE "dimensions.h" 1661 1665 INCLUDE "paramet.h" 1662 INCLUDE "netcdf.inc"1663 1666 INCLUDE "comgeom2.h" 1664 1667 … … 1686 1689 ! ---------------------------------------------- 1687 1690 ! Ouverture du fichier 1688 ierr= NF_CREATE("guide_ins.nc",IOR(NF_CLOBBER,NF_64BIT_OFFSET),nid)1691 ierr=nf90_create("guide_ins.nc",IOR(nf90_clobber,nf90_64bit_offset),nid) 1689 1692 ! Definition des dimensions 1690 ierr= NF_DEF_DIM(nid,"LONU",iip1,id_lonu)1691 ierr= NF_DEF_DIM(nid,"LONV",iip1,id_lonv)1692 ierr= NF_DEF_DIM(nid,"LATU",jjp1,id_latu)1693 ierr= NF_DEF_DIM(nid,"LATV",jjm,id_latv)1694 ierr= NF_DEF_DIM(nid,"LEVEL",llm,id_lev)1695 ierr= NF_DEF_DIM(nid,"TIME",NF_UNLIMITED,id_tim)1693 ierr=nf90_def_dim(nid,"LONU",iip1,id_lonu) 1694 ierr=nf90_def_dim(nid,"LONV",iip1,id_lonv) 1695 ierr=nf90_def_dim(nid,"LATU",jjp1,id_latu) 1696 ierr=nf90_def_dim(nid,"LATV",jjm,id_latv) 1697 ierr=nf90_def_dim(nid,"LEVEL",llm,id_lev) 1698 ierr=nf90_def_dim(nid,"TIME",nf90_unlimited,id_tim) 1696 1699 1697 1700 ! Creation des variables dimensions … … 1710 1713 varid_alpha_q) 1711 1714 1712 ierr= NF_ENDDEF(nid)1715 ierr=nf90_enddef(nid) 1713 1716 1714 1717 ! Enregistrement des variables dimensions … … 1730 1733 ! Cr�ation des variables sauvegard�es 1731 1734 ! -------------------------------------------------------------------- 1732 ierr = NF_REDEF(nid)1735 ierr = nf90_redef(nid) 1733 1736 ! Pressure (GCM) 1734 1737 dim4=(/id_lonv,id_latu,id_lev,id_tim/) … … 1764 1767 ENDIF 1765 1768 1766 ierr = NF_ENDDEF(nid)1767 ierr = NF_CLOSE(nid)1769 ierr = nf90_enddef(nid) 1770 ierr = nf90_close(nid) 1768 1771 ENDIF ! timestep=0 1769 1772 … … 1771 1774 ! Enregistrement du champ 1772 1775 ! -------------------------------------------------------------------- 1773 ierr= NF_OPEN("guide_ins.nc",NF_WRITE,nid)1776 ierr=nf90_open("guide_ins.nc",nf90_write,nid) 1774 1777 1775 1778 IF (varname=="SP") timestep=timestep+1 1776 1779 1777 ierr = NF_INQ_VARID(nid,varname,varid)1780 ierr = nf90_inq_varid(nid,varname,varid) 1778 1781 SELECT CASE (varname) 1779 1782 CASE ("SP","ps") … … 1800 1803 1801 1804 ierr = nf90_put_var(nid, varid, field2, start, count) 1802 ierr = NF_CLOSE(nid)1805 ierr = nf90_close(nid) 1803 1806 1804 1807 END SUBROUTINE guide_out -
LMDZ6/trunk/libf/dyn3d_common/grilles_gcm_netcdf_sub.f90
r5268 r5270 14 14 USE comconst_mod, ONLY: cpp, kappa, g, omeg, daysec, rad, pi 15 15 USE comvert_mod, ONLY: presnivs, preff, pa 16 use netcdf, only: nf90_def_var, nf90_int, nf90_float, nf90_put_var 16 USE netcdf, ONLY: nf90_def_var, nf90_int, nf90_float, nf90_put_var, nf90_clobber, nf90_64bit_offset, nf90_def_dim, & 17 nf90_put_att, nf90_enddef, nf90_create 17 18 18 19 IMPLICIT NONE … … 21 22 INCLUDE "paramet.h" 22 23 INCLUDE "comgeom.h" 23 INCLUDE "netcdf.inc"24 24 25 25 !======================== … … 102 102 ! OPEN output netcdf file 103 103 !------------------------- 104 status= NF_CREATE('grilles_gcm.nc',IOR(NF_CLOBBER,NF_64BIT_OFFSET),ncid_out)104 status=nf90_create('grilles_gcm.nc',IOR(nf90_clobber,nf90_64bit_offset),ncid_out) 105 105 CALL handle_err(status) 106 106 107 107 ! DEFINE output dimensions 108 108 !------------------------- 109 status= NF_DEF_DIM(ncid_out,'lonu',iim+1,out_lonudim)110 CALL handle_err(status) 111 status= NF_DEF_DIM(ncid_out,'lonv',iim+1,out_lonvdim)112 CALL handle_err(status) 113 status= NF_DEF_DIM(ncid_out,'latu',jjm+1,out_latudim)114 CALL handle_err(status) 115 status= NF_DEF_DIM(ncid_out,'latv',jjm,out_latvdim)116 CALL handle_err(status) 117 ! 118 status= NF_DEF_DIM(ncid_out,'lev',llm,out_levdim)109 status=nf90_def_dim(ncid_out,'lonu',iim+1,out_lonudim) 110 CALL handle_err(status) 111 status=nf90_def_dim(ncid_out,'lonv',iim+1,out_lonvdim) 112 CALL handle_err(status) 113 status=nf90_def_dim(ncid_out,'latu',jjm+1,out_latudim) 114 CALL handle_err(status) 115 status=nf90_def_dim(ncid_out,'latv',jjm,out_latvdim) 116 CALL handle_err(status) 117 ! 118 status=nf90_def_dim(ncid_out,'lev',llm,out_levdim) 119 119 CALL handle_err(status) 120 120 … … 124 124 status=NF90_DEF_VAR(ncid_out,'lonu',NF90_FLOAT,out_lonudim, out_lonuid) 125 125 CALL handle_err(status) 126 status= NF_PUT_ATT_TEXT(ncid_out,out_lonuid,'units', 12,'degrees_east')127 status= NF_PUT_ATT_TEXT(ncid_out,out_lonuid,'long_name',19,'Longitude on u grid')126 status=nf90_put_att(ncid_out,out_lonuid,'units','degrees_east') 127 status=nf90_put_att(ncid_out,out_lonuid,'long_name','Longitude on u grid') 128 128 ! Longitudes on "v" dynamical grid 129 129 status=NF90_DEF_VAR(ncid_out,'lonv',NF90_FLOAT,out_lonvdim, out_lonvid) 130 130 CALL handle_err(status) 131 status= NF_PUT_ATT_TEXT(ncid_out,out_lonvid,'units', 12,'degrees_east')132 status= NF_PUT_ATT_TEXT(ncid_out,out_lonvid,'long_name', 19,'Longitude on v grid')131 status=nf90_put_att(ncid_out,out_lonvid,'units','degrees_east') 132 status=nf90_put_att(ncid_out,out_lonvid,'long_name','Longitude on v grid') 133 133 ! Latitudes on "u" dynamical grid 134 134 status=NF90_DEF_VAR(ncid_out,'latu',NF90_FLOAT,out_latudim, out_latuid) 135 135 CALL handle_err(status) 136 status= NF_PUT_ATT_TEXT(ncid_out,out_latuid,'units', 13,'degrees_north')137 status= NF_PUT_ATT_TEXT(ncid_out,out_latuid,'long_name', 18,'Latitude on u grid')136 status=nf90_put_att(ncid_out,out_latuid,'units','degrees_north') 137 status=nf90_put_att(ncid_out,out_latuid,'long_name','Latitude on u grid') 138 138 ! Latitudes on "v" dynamical grid 139 139 status=NF90_DEF_VAR(ncid_out,'latv',NF90_FLOAT,out_latvdim, out_latvid) 140 140 CALL handle_err(status) 141 status= NF_PUT_ATT_TEXT(ncid_out,out_latvid,'units', 13,'degrees_north')142 status= NF_PUT_ATT_TEXT(ncid_out,out_latvid,'long_name', 18,'Latitude on v grid')141 status=nf90_put_att(ncid_out,out_latvid,'units','degrees_north') 142 status=nf90_put_att(ncid_out,out_latvid,'long_name','Latitude on v grid') 143 143 ! "u" lat/lon dynamical grid 144 144 out_dim(1)=out_lonudim … … 146 146 status=NF90_DEF_VAR(ncid_out,'grille_u',NF90_FLOAT,out_dim, out_uid) 147 147 CALL handle_err(status) 148 status= NF_PUT_ATT_TEXT(ncid_out,out_uid,'units', 3,'m/s')149 status= NF_PUT_ATT_TEXT(ncid_out,out_uid,'long_name', 21,'u-wind dynamical grid')148 status=nf90_put_att(ncid_out,out_uid,'units','m/s') 149 status=nf90_put_att(ncid_out,out_uid,'long_name','u-wind dynamical grid') 150 150 ! "v" lat/lon dynamical grid 151 151 out_dim(1)=out_lonvdim … … 153 153 status=NF90_DEF_VAR(ncid_out,'grille_v',NF90_FLOAT,out_dim, out_vid) 154 154 CALL handle_err(status) 155 status= NF_PUT_ATT_TEXT(ncid_out,out_vid,'units', 3,'m/s')156 status= NF_PUT_ATT_TEXT(ncid_out,out_vid,'long_name', 21,'v-wind dynamical grid')155 status=nf90_put_att(ncid_out,out_vid,'units','m/s') 156 status=nf90_put_att(ncid_out,out_vid,'long_name','v-wind dynamical grid') 157 157 ! "s" (scalar) lat/lon dynamical grid 158 158 out_dim(1)=out_lonvdim … … 160 160 status=NF90_DEF_VAR(ncid_out,'grille_s',NF90_FLOAT,out_dim, out_tempid) 161 161 CALL handle_err(status) 162 status= NF_PUT_ATT_TEXT(ncid_out,out_tempid,'units', 6,'Kelvin')163 status= NF_PUT_ATT_TEXT(ncid_out,out_tempid,'long_name',21,'scalar dynamical grid')162 status=nf90_put_att(ncid_out,out_tempid,'units','Kelvin') 163 status=nf90_put_att(ncid_out,out_tempid,'long_name','scalar dynamical grid') 164 164 ! 165 165 ! for INCA : … … 167 167 status=NF90_DEF_VAR(ncid_out,'presnivs',NF90_FLOAT,out_levdim, presnivs_id) 168 168 CALL handle_err(status) 169 status= NF_PUT_ATT_TEXT(ncid_out,presnivs_id,'units', 2,'Pa')170 status= NF_PUT_ATT_TEXT(ncid_out,presnivs_id,'long_name',15,'Vertical levels')169 status=nf90_put_att(ncid_out,presnivs_id,'units','Pa') 170 status=nf90_put_att(ncid_out,presnivs_id,'long_name','Vertical levels') 171 171 ! surface geopotential height: named "phis" as the sfc geopotential, is actually phis/g 172 172 out_dim(1)=out_lonvdim … … 174 174 status = nf90_def_var(ncid_out,'phis',NF90_FLOAT,out_dim,phis_id) 175 175 CALL handle_err(status) 176 status= NF_PUT_ATT_TEXT(ncid_out,phis_id,'units', 1,'m')177 status= NF_PUT_ATT_TEXT(ncid_out,phis_id,'long_name',27,'surface geopotential height')176 status=nf90_put_att(ncid_out,phis_id,'units','m') 177 status=nf90_put_att(ncid_out,phis_id,'long_name','surface geopotential height') 178 178 ! gridcell area 179 179 status = nf90_def_var(ncid_out,'aire',NF90_FLOAT,out_dim,area_id) 180 180 CALL handle_err(status) 181 status= NF_PUT_ATT_TEXT(ncid_out,area_id,'units', 2,'m2')182 status= NF_PUT_ATT_TEXT(ncid_out,area_id,'long_name',13,'gridcell area')181 status=nf90_put_att(ncid_out,area_id,'units','m2') 182 status=nf90_put_att(ncid_out,area_id,'long_name','gridcell area') 183 183 ! land-sea mask (nearest integer approx) 184 184 status = nf90_def_var(ncid_out,'mask',NF90_INT,out_dim,mask_id) 185 185 CALL handle_err(status) 186 status= NF_PUT_ATT_TEXT(ncid_out,mask_id,'long_name',27,'land-sea mask (nINT approx)')186 status=nf90_put_att(ncid_out,mask_id,'long_name','land-sea mask (nINT approx)') 187 187 188 188 ! END the 'define' mode in netCDF file 189 status= NF_ENDDEF(ncid_out)189 status=nf90_enddef(ncid_out) 190 190 CALL handle_err(status) 191 191 … … 232 232 233 233 SUBROUTINE handle_err(status) 234 INCLUDE "netcdf.inc" 234 USE netcdf, ONLY: nf90_noerr, nf90_strerror 235 IMPLICIT NONE 235 236 236 237 INTEGER status 237 IF (status.NE.nf _noerr) THEN238 PRINT *, NF_STRERROR(status)238 IF (status.NE.nf90_noerr) THEN 239 PRINT *,nf90_strerror(status) 239 240 CALL abort_gcm('grilles_gcm_netcdf','netcdf error',1) 240 241 ENDIF -
LMDZ6/trunk/libf/dyn3dmem/guide_loc_mod.f90
r5268 r5270 11 11 USE getparam, only: ini_getparam, fin_getparam, getpar 12 12 USE Write_Field_loc 13 use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, & 14 nf90_inq_dimid, nf90_inquire_dimension 13 USE netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close, & 14 nf90_inq_dimid, nf90_inquire_dimension, nf90_inq_dimid, & 15 nf90_inquire_dimension, nf90_enddef, nf90_def_dim, nf90_put_var, nf90_noerr, nf90_close, nf90_inq_varid, & 16 nf90_redef, nf90_write, nf90_unlimited, nf90_float, nf90_clobber, nf90_64bit_offset, nf90_float, & 17 nf90_create, nf90_def_var, nf90_open 15 18 USE parallel_lmdz 16 19 USE pres2lev_mod, only: pres2lev … … 81 84 INCLUDE "dimensions.h" 82 85 INCLUDE "paramet.h" 83 INCLUDE "netcdf.inc"84 86 85 87 INTEGER :: error,ncidpl,rid,rcod … … 177 179 if (ncidpl.eq.-99) then 178 180 rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl) 179 if (rcod.NE. NF_NOERR) THEN181 if (rcod.NE.nf90_noerr) THEN 180 182 abort_message=' Nudging error -> no file apbp.nc' 181 183 CALL abort_gcm(modname,abort_message,1) … … 185 187 if (ncidpl.EQ.-99) then 186 188 rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl) 187 if (rcod.NE. NF_NOERR) THEN189 if (rcod.NE.nf90_noerr) THEN 188 190 abort_message=' Nudging error -> no file P.nc' 189 191 CALL abort_gcm(modname,abort_message,1) … … 194 196 if (ncidpl.eq.-99) then 195 197 rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl) 196 if (rcod.NE. NF_NOERR) THEN198 if (rcod.NE.nf90_noerr) THEN 197 199 abort_message=' Nudging error -> no file u.nc' 198 200 CALL abort_gcm(modname,abort_message,1) … … 205 207 if (ncidpl.eq.-99) then 206 208 rcod=nf90_open('v.nc',nf90_nowrite,ncidpl) 207 if (rcod.NE. NF_NOERR) THEN209 if (rcod.NE.nf90_noerr) THEN 208 210 abort_message=' Nudging error -> no file v.nc' 209 211 CALL abort_gcm(modname,abort_message,1) … … 215 217 if (ncidpl.eq.-99) then 216 218 rcod=nf90_open('T.nc',nf90_nowrite,ncidpl) 217 if (rcod.NE. NF_NOERR) THEN219 if (rcod.NE.nf90_noerr) THEN 218 220 abort_message=' Nudging error -> no file T.nc' 219 221 CALL abort_gcm(modname,abort_message,1) … … 226 228 if (ncidpl.eq.-99) then 227 229 rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl) 228 if (rcod.NE. NF_NOERR) THEN230 if (rcod.NE.nf90_noerr) THEN 229 231 abort_message=' Nudging error -> no file hur.nc' 230 232 CALL abort_gcm(modname,abort_message,1) … … 234 236 235 237 endif 236 error= NF_INQ_DIMID(ncidpl,'LEVEL',rid)237 IF (error.NE. NF_NOERR) error=NF_INQ_DIMID(ncidpl,'PRESSURE',rid)238 IF (error.NE. NF_NOERR) THEN238 error=nf90_inq_dimid(ncidpl,'LEVEL',rid) 239 IF (error.NE.nf90_noerr) error=nf90_inq_dimid(ncidpl,'PRESSURE',rid) 240 IF (error.NE.nf90_noerr) THEN 239 241 abort_message='Nudging: error reading pressure levels' 240 242 CALL abort_gcm(modname,abort_message,1) 241 243 ENDIF 242 error= NF_INQ_DIMLEN(ncidpl,rid,nlevnc)244 error=nf90_inquire_dimension(ncidpl,rid,len=nlevnc) 243 245 write(*,*)trim(modname)//' : number of vertical levels nlevnc', nlevnc 244 246 rcod = nf90_close(ncidpl) … … 1575 1577 USE netcdf, ONLY: nf90_put_var 1576 1578 IMPLICIT NONE 1577 1578 include "netcdf.inc"1579 1579 include "dimensions.h" 1580 1580 include "paramet.h" … … 1605 1605 write(*,*),trim(modname)//' Reading nudging on model levels' 1606 1606 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1607 IF (rcode.NE. NF_NOERR) THEN1607 IF (rcode.NE.nf90_noerr) THEN 1608 1608 abort_message='Nudging: error -> no file apbp.nc' 1609 1609 CALL abort_gcm(modname,abort_message,1) 1610 1610 ENDIF 1611 1611 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 1612 IF (rcode.NE. NF_NOERR) THEN1612 IF (rcode.NE.nf90_noerr) THEN 1613 1613 abort_message='Nudging: error -> no AP variable in file apbp.nc' 1614 1614 CALL abort_gcm(modname,abort_message,1) 1615 1615 ENDIF 1616 1616 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 1617 IF (rcode.NE. NF_NOERR) THEN1617 IF (rcode.NE.nf90_noerr) THEN 1618 1618 abort_message='Nudging: error -> no BP variable in file apbp.nc' 1619 1619 CALL abort_gcm(modname,abort_message,1) … … 1625 1625 if (guide_plevs.EQ.2) then 1626 1626 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1627 IF (rcode.NE. NF_NOERR) THEN1627 IF (rcode.NE.nf90_noerr) THEN 1628 1628 abort_message='Nudging: error -> no file P.nc' 1629 1629 CALL abort_gcm(modname,abort_message,1) 1630 1630 ENDIF 1631 1631 rcode = nf90_inq_varid(ncidp, 'PRES', varidp) 1632 IF (rcode.NE. NF_NOERR) THEN1632 IF (rcode.NE.nf90_noerr) THEN 1633 1633 abort_message='Nudging: error -> no PRES variable in file P.nc' 1634 1634 CALL abort_gcm(modname,abort_message,1) … … 1641 1641 if (guide_u) then 1642 1642 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1643 IF (rcode.NE. NF_NOERR) THEN1643 IF (rcode.NE.nf90_noerr) THEN 1644 1644 abort_message='Nudging: error -> no file u.nc' 1645 1645 CALL abort_gcm(modname,abort_message,1) 1646 1646 ENDIF 1647 1647 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 1648 IF (rcode.NE. NF_NOERR) THEN1648 IF (rcode.NE.nf90_noerr) THEN 1649 1649 abort_message='Nudging: error -> no UWND variable in file u.nc' 1650 1650 CALL abort_gcm(modname,abort_message,1) … … 1673 1673 if (guide_v) then 1674 1674 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1675 IF (rcode.NE. NF_NOERR) THEN1675 IF (rcode.NE.nf90_noerr) THEN 1676 1676 abort_message='Nudging: error -> no file v.nc' 1677 1677 CALL abort_gcm(modname,abort_message,1) 1678 1678 ENDIF 1679 1679 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 1680 IF (rcode.NE. NF_NOERR) THEN1680 IF (rcode.NE.nf90_noerr) THEN 1681 1681 abort_message='Nudging: error -> no VWND variable in file v.nc' 1682 1682 CALL abort_gcm(modname,abort_message,1) … … 1706 1706 if (guide_T) then 1707 1707 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1708 IF (rcode.NE. NF_NOERR) THEN1708 IF (rcode.NE.nf90_noerr) THEN 1709 1709 abort_message='Nudging: error -> no file T.nc' 1710 1710 CALL abort_gcm(modname,abort_message,1) 1711 1711 ENDIF 1712 1712 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 1713 IF (rcode.NE. NF_NOERR) THEN1713 IF (rcode.NE.nf90_noerr) THEN 1714 1714 abort_message='Nudging: error -> no AIR variable in file T.nc' 1715 1715 CALL abort_gcm(modname,abort_message,1) … … 1737 1737 if (guide_Q) then 1738 1738 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 1739 IF (rcode.NE. NF_NOERR) THEN1739 IF (rcode.NE.nf90_noerr) THEN 1740 1740 abort_message='Nudging: error -> no file hur.nc' 1741 1741 CALL abort_gcm(modname,abort_message,1) 1742 1742 ENDIF 1743 1743 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 1744 IF (rcode.NE. NF_NOERR) THEN1744 IF (rcode.NE.nf90_noerr) THEN 1745 1745 abort_message='Nudging: error -> no RH variable in file hur.nc' 1746 1746 CALL abort_gcm(modname,abort_message,1) … … 1769 1769 if ((guide_P).OR.(guide_plevs.EQ.1)) then 1770 1770 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 1771 IF (rcode.NE. NF_NOERR) THEN1771 IF (rcode.NE.nf90_noerr) THEN 1772 1772 abort_message='Nudging: error -> no file ps.nc' 1773 1773 CALL abort_gcm(modname,abort_message,1) 1774 1774 ENDIF 1775 1775 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 1776 IF (rcode.NE. NF_NOERR) THEN1776 IF (rcode.NE.nf90_noerr) THEN 1777 1777 abort_message='Nudging: error -> no SP variable in file ps.nc' 1778 1778 CALL abort_gcm(modname,abort_message,1) … … 1894 1894 USE netcdf, ONLY: nf90_put_var 1895 1895 IMPLICIT NONE 1896 1897 include "netcdf.inc"1898 1896 include "dimensions.h" 1899 1897 include "paramet.h" … … 1927 1925 write(*,*)trim(modname)//' Reading nudging on model levels' 1928 1926 rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl) 1929 IF (rcode.NE. NF_NOERR) THEN1927 IF (rcode.NE.nf90_noerr) THEN 1930 1928 abort_message='Nudging: error -> no file apbp.nc' 1931 1929 CALL abort_gcm(modname,abort_message,1) 1932 1930 ENDIF 1933 1931 rcode = nf90_inq_varid(ncidpl, 'AP', varidap) 1934 IF (rcode.NE. NF_NOERR) THEN1932 IF (rcode.NE.nf90_noerr) THEN 1935 1933 abort_message='Nudging: error -> no AP variable in file apbp.nc' 1936 1934 CALL abort_gcm(modname,abort_message,1) 1937 1935 ENDIF 1938 1936 rcode = nf90_inq_varid(ncidpl, 'BP', varidbp) 1939 IF (rcode.NE. NF_NOERR) THEN1937 IF (rcode.NE.nf90_noerr) THEN 1940 1938 abort_message='Nudging: error -> no BP variable in file apbp.nc' 1941 1939 CALL abort_gcm(modname,abort_message,1) … … 1946 1944 if (guide_plevs.EQ.2) then 1947 1945 rcode = nf90_open('P.nc', nf90_nowrite, ncidp) 1948 IF (rcode.NE. NF_NOERR) THEN1946 IF (rcode.NE.nf90_noerr) THEN 1949 1947 abort_message='Nudging: error -> no file P.nc' 1950 1948 CALL abort_gcm(modname,abort_message,1) 1951 1949 ENDIF 1952 1950 rcode = nf90_inq_varid(ncidp, 'PRES', varidp) 1953 IF (rcode.NE. NF_NOERR) THEN1951 IF (rcode.NE.nf90_noerr) THEN 1954 1952 abort_message='Nudging: error -> no PRES variable in file P.nc' 1955 1953 CALL abort_gcm(modname,abort_message,1) … … 1961 1959 if (guide_u) then 1962 1960 rcode = nf90_open('u.nc', nf90_nowrite, ncidu) 1963 IF (rcode.NE. NF_NOERR) THEN1961 IF (rcode.NE.nf90_noerr) THEN 1964 1962 abort_message='Nudging: error -> no file u.nc' 1965 1963 CALL abort_gcm(modname,abort_message,1) 1966 1964 ENDIF 1967 1965 rcode = nf90_inq_varid(ncidu, 'UWND', varidu) 1968 IF (rcode.NE. NF_NOERR) THEN1966 IF (rcode.NE.nf90_noerr) THEN 1969 1967 abort_message='Nudging: error -> no UWND variable in file u.nc' 1970 1968 CALL abort_gcm(modname,abort_message,1) … … 1977 1975 if (guide_v) then 1978 1976 rcode = nf90_open('v.nc', nf90_nowrite, ncidv) 1979 IF (rcode.NE. NF_NOERR) THEN1977 IF (rcode.NE.nf90_noerr) THEN 1980 1978 abort_message='Nudging: error -> no file v.nc' 1981 1979 CALL abort_gcm(modname,abort_message,1) 1982 1980 ENDIF 1983 1981 rcode = nf90_inq_varid(ncidv, 'VWND', varidv) 1984 IF (rcode.NE. NF_NOERR) THEN1982 IF (rcode.NE.nf90_noerr) THEN 1985 1983 abort_message='Nudging: error -> no VWND variable in file v.nc' 1986 1984 CALL abort_gcm(modname,abort_message,1) … … 1992 1990 if (guide_T) then 1993 1991 rcode = nf90_open('T.nc', nf90_nowrite, ncidt) 1994 IF (rcode.NE. NF_NOERR) THEN1992 IF (rcode.NE.nf90_noerr) THEN 1995 1993 abort_message='Nudging: error -> no file T.nc' 1996 1994 CALL abort_gcm(modname,abort_message,1) 1997 1995 ENDIF 1998 1996 rcode = nf90_inq_varid(ncidt, 'AIR', varidt) 1999 IF (rcode.NE. NF_NOERR) THEN1997 IF (rcode.NE.nf90_noerr) THEN 2000 1998 abort_message='Nudging: error -> no AIR variable in file T.nc' 2001 1999 CALL abort_gcm(modname,abort_message,1) … … 2007 2005 if (guide_Q) then 2008 2006 rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ) 2009 IF (rcode.NE. NF_NOERR) THEN2007 IF (rcode.NE.nf90_noerr) THEN 2010 2008 abort_message='Nudging: error -> no file hur.nc' 2011 2009 CALL abort_gcm(modname,abort_message,1) 2012 2010 ENDIF 2013 2011 rcode = nf90_inq_varid(ncidQ, 'RH', varidQ) 2014 IF (rcode.NE. NF_NOERR) THEN2012 IF (rcode.NE.nf90_noerr) THEN 2015 2013 abort_message='Nudging: error -> no RH,variable in file hur.nc' 2016 2014 CALL abort_gcm(modname,abort_message,1) … … 2022 2020 if ((guide_P).OR.(guide_plevs.EQ.1)) then 2023 2021 rcode = nf90_open('ps.nc', nf90_nowrite, ncidps) 2024 IF (rcode.NE. NF_NOERR) THEN2022 IF (rcode.NE.nf90_noerr) THEN 2025 2023 abort_message='Nudging: error -> no file ps.nc' 2026 2024 CALL abort_gcm(modname,abort_message,1) 2027 2025 ENDIF 2028 2026 rcode = nf90_inq_varid(ncidps, 'SP', varidps) 2029 IF (rcode.NE. NF_NOERR) THEN2027 IF (rcode.NE.nf90_noerr) THEN 2030 2028 abort_message='Nudging: error -> no SP variable in file ps.nc' 2031 2029 CALL abort_gcm(modname,abort_message,1) … … 2177 2175 INCLUDE "dimensions.h" 2178 2176 INCLUDE "paramet.h" 2179 INCLUDE "netcdf.inc"2180 2177 INCLUDE "comgeom2.h" 2181 2178 … … 2234 2231 ! ---------------------------------------------- 2235 2232 ! Ouverture du fichier 2236 ierr= NF_CREATE("guide_ins.nc",IOR(NF_CLOBBER,NF_64BIT_OFFSET),nid)2233 ierr=nf90_create("guide_ins.nc",IOR(nf90_clobber,nf90_64bit_offset),nid) 2237 2234 ! Definition des dimensions 2238 ierr= NF_DEF_DIM(nid,"LONU",iip1,id_lonu)2239 ierr= NF_DEF_DIM(nid,"LONV",iip1,id_lonv)2240 ierr= NF_DEF_DIM(nid,"LATU",jjp1,id_latu)2241 ierr= NF_DEF_DIM(nid,"LATV",jjm,id_latv)2242 ierr= NF_DEF_DIM(nid,"LEVEL",llm,id_lev)2243 ierr= NF_DEF_DIM(nid,"TIME",NF_UNLIMITED,id_tim)2235 ierr=nf90_def_dim(nid,"LONU",iip1,id_lonu) 2236 ierr=nf90_def_dim(nid,"LONV",iip1,id_lonv) 2237 ierr=nf90_def_dim(nid,"LATU",jjp1,id_latu) 2238 ierr=nf90_def_dim(nid,"LATV",jjm,id_latv) 2239 ierr=nf90_def_dim(nid,"LEVEL",llm,id_lev) 2240 ierr=nf90_def_dim(nid,"TIME",nf90_unlimited,id_tim) 2244 2241 2245 2242 ! Creation des variables dimensions 2246 ierr= NF_DEF_VAR(nid,"LONU",NF_FLOAT,1,id_lonu,vid_lonu)2247 ierr= NF_DEF_VAR(nid,"LONV",NF_FLOAT,1,id_lonv,vid_lonv)2248 ierr= NF_DEF_VAR(nid,"LATU",NF_FLOAT,1,id_latu,vid_latu)2249 ierr= NF_DEF_VAR(nid,"LATV",NF_FLOAT,1,id_latv,vid_latv)2250 ierr= NF_DEF_VAR(nid,"LEVEL",NF_FLOAT,1,id_lev,vid_lev)2251 ierr= NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu)2252 ierr= NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv)2253 ierr= NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au)2254 ierr= NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av)2243 ierr=nf90_def_var(nid,"LONU",nf90_float,id_lonu,vid_lonu) 2244 ierr=nf90_def_var(nid,"LONV",nf90_float,id_lonv,vid_lonv) 2245 ierr=nf90_def_var(nid,"LATU",nf90_float,id_latu,vid_latu) 2246 ierr=nf90_def_var(nid,"LATV",nf90_float,id_latv,vid_latv) 2247 ierr=nf90_def_var(nid,"LEVEL",nf90_float,id_lev,vid_lev) 2248 ierr=nf90_def_var(nid,"cu",nf90_float,(/id_lonu,id_latu/),vid_cu) 2249 ierr=nf90_def_var(nid,"cv",nf90_float,(/id_lonv,id_latv/),vid_cv) 2250 ierr=nf90_def_var(nid,"au",nf90_float,(/id_lonu,id_latu/),vid_au) 2251 ierr=nf90_def_var(nid,"av",nf90_float,(/id_lonv,id_latv/),vid_av) 2255 2252 call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), & 2256 2253 varid_alpha_t) … … 2258 2255 varid_alpha_q) 2259 2256 2260 ierr= NF_ENDDEF(nid)2257 ierr=nf90_enddef(nid) 2261 2258 2262 2259 ! Enregistrement des variables dimensions … … 2275 2272 ! Cr�ation des variables sauvegard�es 2276 2273 ! -------------------------------------------------------------------- 2277 ierr = NF_REDEF(nid)2274 ierr = nf90_redef(nid) 2278 2275 ! Pressure (GCM) 2279 2276 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 2280 ierr = NF_DEF_VAR(nid,"SP",NF_FLOAT,4,dim4,varid)2277 ierr = nf90_def_var(nid,"SP",nf90_float,dim4,varid) 2281 2278 ! Surface pressure (guidage) 2282 2279 IF (guide_P) THEN 2283 2280 dim3=(/id_lonv,id_latu,id_tim/) 2284 ierr = NF_DEF_VAR(nid,"ps",NF_FLOAT,3,dim3,varid)2281 ierr = nf90_def_var(nid,"ps",nf90_float,dim3,varid) 2285 2282 ENDIF 2286 2283 ! Zonal wind 2287 2284 IF (guide_u) THEN 2288 2285 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 2289 ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid)2290 ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid)2291 ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid)2286 ierr = nf90_def_var(nid,"u",nf90_float,dim4,varid) 2287 ierr = nf90_def_var(nid,"ua",nf90_float,dim4,varid) 2288 ierr = nf90_def_var(nid,"ucov",nf90_float,dim4,varid) 2292 2289 ENDIF 2293 2290 ! Merid. wind 2294 2291 IF (guide_v) THEN 2295 2292 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 2296 ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid)2297 ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid)2298 ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid)2293 ierr = nf90_def_var(nid,"v",nf90_float,dim4,varid) 2294 ierr = nf90_def_var(nid,"va",nf90_float,dim4,varid) 2295 ierr = nf90_def_var(nid,"vcov",nf90_float,dim4,varid) 2299 2296 ENDIF 2300 2297 ! Pot. Temperature 2301 2298 IF (guide_T) THEN 2302 2299 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 2303 ierr = NF_DEF_VAR(nid,"teta",NF_FLOAT,4,dim4,varid)2300 ierr = nf90_def_var(nid,"teta",nf90_float,dim4,varid) 2304 2301 ENDIF 2305 2302 ! Specific Humidity 2306 2303 IF (guide_Q) THEN 2307 2304 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 2308 ierr = NF_DEF_VAR(nid,"q",NF_FLOAT,4,dim4,varid)2305 ierr = nf90_def_var(nid,"q",nf90_float,dim4,varid) 2309 2306 ENDIF 2310 2307 2311 ierr = NF_ENDDEF(nid)2312 ierr = NF_CLOSE(nid)2308 ierr = nf90_enddef(nid) 2309 ierr = nf90_close(nid) 2313 2310 ENDIF ! timestep=0 2314 2311 … … 2317 2314 ! -------------------------------------------------------------------- 2318 2315 2319 ierr= NF_OPEN("guide_ins.nc",NF_WRITE,nid)2316 ierr=nf90_open("guide_ins.nc",nf90_write,nid) 2320 2317 2321 2318 IF (varname=="SP") timestep=timestep+1 2322 2319 2323 ierr = NF_INQ_VARID(nid,varname,varid)2320 ierr = nf90_inq_varid(nid,varname,varid) 2324 2321 SELECT CASE (varname) 2325 2322 CASE ("SP","ps") … … 2360 2357 2361 2358 ierr = nf90_put_var(nid, varid, field_glo, start, count) 2362 ierr = NF_CLOSE(nid)2359 ierr = nf90_close(nid) 2363 2360 2364 2361 DEALLOCATE(field_glo) -
LMDZ6/trunk/libf/misc/write_field.f90
r5268 r5270 3 3 ! 4 4 module write_field 5 USE netcdf, ONLY: nf90_sync, nf90_put_var, nf90_enddef, nf90_def_dim, nf90_unlimited, & 6 nf90_clobber, nf90_create, nf90_def_var, nf90_double 5 7 USE strings_mod, ONLY: int2str 6 8 IMPLICIT NONE; PRIVATE … … 75 77 subroutine WriteField_gen(name,Field,dimx,dimy,dimz) 76 78 implicit none 77 include 'netcdf.inc'78 79 character(len=*) :: name 79 80 integer :: dimx,dimy,dimz … … 104 105 count(4)=1 105 106 106 status = NF_PUT_VARA_DOUBLE(FieldId(Index),FieldVarId(Index),start,count,Field)107 status = NF_SYNC(FieldId(Index))107 status = nf90_put_var(FieldId(Index),FieldVarId(Index),Field,start,count) 108 status = nf90_sync(FieldId(Index)) 108 109 109 110 end subroutine WriteField_gen … … 111 112 subroutine CreateNewField(name,dimx,dimy,dimz) 112 113 implicit none 113 include 'netcdf.inc'114 114 character(len=*) :: name 115 115 integer :: dimx,dimy,dimz … … 123 123 124 124 125 status = NF_CREATE(TRIM(ADJUSTL(name))//'.nc', NF_CLOBBER, FieldId(NbField))126 status = NF_DEF_DIM(FieldId(NbField),'X',dimx,TabDim(1))127 status = NF_DEF_DIM(FieldId(NbField),'Y',dimy,TabDim(2))128 status = NF_DEF_DIM(FieldId(NbField),'Z',dimz,TabDim(3))129 status = NF_DEF_DIM(FieldId(NbField),'iter',NF_UNLIMITED,TabDim(4))130 status = NF_DEF_VAR(FieldId(NbField),FieldName(NbField),NF_DOUBLE,4,TabDim,FieldVarId(NbField))131 status = NF_ENDDEF(FieldId(NbField))125 status = nf90_create(TRIM(ADJUSTL(name))//'.nc', nf90_clobber, FieldId(NbField)) 126 status = nf90_def_dim(FieldId(NbField),'X',dimx,TabDim(1)) 127 status = nf90_def_dim(FieldId(NbField),'Y',dimy,TabDim(2)) 128 status = nf90_def_dim(FieldId(NbField),'Z',dimz,TabDim(3)) 129 status = nf90_def_dim(FieldId(NbField),'iter',nf90_unlimited,TabDim(4)) 130 status = nf90_def_var(FieldId(NbField),FieldName(NbField),nf90_double,TabDim,FieldVarId(NbField)) 131 status = nf90_enddef(FieldId(NbField)) 132 132 133 133 end subroutine CreateNewField -
LMDZ6/trunk/libf/phylmd/Dust/condsurfc.f90
r5246 r5270 4 4 lmt_omnat) 5 5 USE dimphy 6 USE netcdf, ONLY: nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, nf90_nowrite, nf90_get_var 6 7 IMPLICIT none 7 8 ! … … 10 11 ! 11 12 INCLUDE "dimensions.h" 12 INCLUDE "netcdf.inc"13 13 14 14 REAL :: lmt_bcff(klon), lmt_bcbb(klon),lmt_bc_penner(klon) … … 34 34 ENDIF 35 35 ! 36 ierr = NF_OPEN ("limitcarbon.nc", NF_NOWRITE, nid1)37 if (ierr.ne. NF_NOERR) then36 ierr = nf90_open ("limitcarbon.nc", nf90_nowrite, nid1) 37 if (ierr.ne.nf90_noerr) then 38 38 write(6,*)' Pb d''ouverture du fichier limitbc.nc' 39 39 write(6,*)' ierr = ', ierr … … 48 48 ! 49 49 ! 50 ierr = NF_INQ_VARID(nid1, "BCFF", nvarid)50 ierr = nf90_inq_varid(nid1, "BCFF", nvarid) 51 51 !nhl #ifdef NC_DOUBLE 52 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcff)52 ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais) 53 53 ! print *,'IERR = ',ierr 54 ! print *,' NF_NOERR = ',NF_NOERR54 ! print *,'nf90_noerr = ',nf90_noerr 55 55 ! print *,'debut = ',debut 56 56 ! print *,'epais = ',epais 57 57 !nhl #else 58 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcff)58 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais) 59 59 !nhl #endif 60 IF (ierr .NE. NF_NOERR) THEN60 IF (ierr .NE. nf90_noerr) THEN 61 61 PRINT*, 'Pb de lecture pour les sources BC' 62 62 CALL exit(1) … … 64 64 ! 65 65 ! 66 ierr = NF_INQ_VARID(nid1, "BCBB", nvarid)66 ierr = nf90_inq_varid(nid1, "BCBB", nvarid) 67 67 !nhl #ifdef NC_DOUBLE 68 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbb)68 ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais) 69 69 !nhl #else 70 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbb)70 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais) 71 71 !nhl #endif 72 IF (ierr .NE. NF_NOERR) THEN72 IF (ierr .NE. nf90_noerr) THEN 73 73 PRINT*, 'Pb de lecture pour les sources BC-biomass' 74 74 CALL exit(1) … … 76 76 ! 77 77 ! 78 ierr = NF_INQ_VARID(nid1, "BCBL", nvarid)78 ierr = nf90_inq_varid(nid1, "BCBL", nvarid) 79 79 !nhl #ifdef NC_DOUBLE 80 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbl)80 ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais) 81 81 !nhl #else 82 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbl)82 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais) 83 83 !nhl #endif 84 IF (ierr .NE. NF_NOERR) THEN84 IF (ierr .NE. nf90_noerr) THEN 85 85 PRINT*, 'Pb de lecture pour les sources BC low' 86 86 CALL exit(1) … … 88 88 ! 89 89 ! 90 ierr = NF_INQ_VARID(nid1, "BCBH", nvarid)90 ierr = nf90_inq_varid(nid1, "BCBH", nvarid) 91 91 !nhl #ifdef NC_DOUBLE 92 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbh)92 ierr = nf90_get_var(nid1, nvarid, lmt_bcbbh, debut, epais) 93 93 !nhl #else 94 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbh)94 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_bcbbh, debut, epais) 95 95 !nhl #endif 96 IF (ierr .NE. NF_NOERR) THEN96 IF (ierr .NE. nf90_noerr) THEN 97 97 PRINT*, 'Pb de lecture pour les sources BC high' 98 98 CALL exit(1) 99 99 ENDIF 100 100 ! 101 ierr = NF_INQ_VARID(nid1, "TERP", nvarid)101 ierr = nf90_inq_varid(nid1, "TERP", nvarid) 102 102 !nhl #ifdef NC_DOUBLE 103 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_terp)103 ierr = nf90_get_var(nid1, nvarid, lmt_terp, debut, epais) 104 104 !nhl #else 105 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_terp)105 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_terp, debut, epais) 106 106 !nhl #endif 107 IF (ierr .NE. NF_NOERR) THEN107 IF (ierr .NE. nf90_noerr) THEN 108 108 PRINT*, 'Pb de lecture pour les sources Terpene' 109 109 CALL exit(1) … … 111 111 ! 112 112 ! 113 ierr = NF_INQ_VARID (nid1, "BC_penner", nvarid) 114 !nhl #ifdef NC_DOUBLE 115 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, & 116 epais, lmt_bc_penner) 117 !nhl #else 118 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, 119 !nhl . lmt_bc_penner) 120 !nhl #endif 121 IF (ierr .NE. NF_NOERR) THEN 113 ierr = nf90_inq_varid(nid1, "BC_penner", nvarid) 114 ierr = nf90_get_var(nid1, nvarid, lmt_bc_penner, debut, & 115 epais) 116 IF (ierr .NE. nf90_noerr) THEN 122 117 PRINT*, 'Pb de lecture pour les sources BC Penner' 123 118 CALL exit(1) … … 125 120 ! 126 121 ! 127 ierr = NF_INQ_VARID(nid1, "OMFF", nvarid)122 ierr = nf90_inq_varid(nid1, "OMFF", nvarid) 128 123 !nhl #ifdef NC_DOUBLE 129 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_omff)124 ierr = nf90_get_var(nid1, nvarid, lmt_omff, debut, epais) 130 125 !nhl #else 131 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_omff)126 !nhl ierr = nf90_get_var(nid1, nvarid, lmt_omff, debut, epais) 132 127 !nhl #endif 133 IF (ierr .NE. NF_NOERR) THEN128 IF (ierr .NE. nf90_noerr) THEN 134 129 PRINT*, 'Pb de lecture pour les sources om-ifossil' 135 130 CALL exit(1) … … 144 139 ENDDO 145 140 ! 146 ierr = NF_CLOSE(nid1)141 ierr = nf90_close(nid1) 147 142 PRINT*, 'Carbon sources lues pour jour: ', jour 148 143 ! -
LMDZ6/trunk/libf/phylmd/Dust/condsurfc_new.f90
r5246 r5270 6 6 USE mod_phys_lmdz_para 7 7 USE dimphy 8 USE netcdf, ONLY: nf90_get_var, nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, nf90_nowrite 8 9 IMPLICIT none 9 10 ! … … 12 13 ! 13 14 INCLUDE "dimensions.h" 14 INCLUDE "netcdf.inc"15 15 16 16 REAL :: lmt_bcff(klon), lmt_bcnff(klon), lmt_bcba(klon) … … 57 57 !======================================================================= 58 58 ! 59 ierr = NF_OPEN ("carbon_emissions.nc", NF_NOWRITE, nid1)60 if (ierr.ne. NF_NOERR) then59 ierr = nf90_open ("carbon_emissions.nc", nf90_nowrite, nid1) 60 if (ierr.ne.nf90_noerr) then 61 61 write(6,*)' Pb d''ouverture du fichier limitbc.nc' 62 62 write(6,*)' ierr = ', ierr … … 66 66 ! BC emissions from fossil fuel combustion 67 67 ! 68 ierr = NF_INQ_VARID(nid1, "BCFF", nvarid)69 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &70 lmt_bcff_glo )71 IF (ierr .NE. NF_NOERR) THEN68 ierr = nf90_inq_varid(nid1, "BCFF", nvarid) 69 ierr = nf90_get_var(nid1, nvarid, & 70 lmt_bcff_glo, debut, epais) 71 IF (ierr .NE. nf90_noerr) THEN 72 72 PRINT*, 'Pb de lecture pour les sources BC' 73 73 CALL exit(1) … … 78 78 ! BC emissions from non fossil fuel combustion 79 79 ! 80 ierr = NF_INQ_VARID(nid1, "BCNFF", nvarid)81 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &82 lmt_bcnff_glo )83 IF (ierr .NE. NF_NOERR) THEN80 ierr = nf90_inq_varid(nid1, "BCNFF", nvarid) 81 ierr = nf90_get_var(nid1, nvarid, & 82 lmt_bcnff_glo, debut, epais) 83 IF (ierr .NE. nf90_noerr) THEN 84 84 PRINT*, 'Pb de lecture pour les sources BC' 85 85 CALL exit(1) … … 88 88 ! Low BC emissions from biomass burning 89 89 ! 90 ierr = NF_INQ_VARID(nid1, "BCBBL", nvarid)91 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &92 lmt_bcbbl_glo )93 IF (ierr .NE. NF_NOERR) THEN90 ierr = nf90_inq_varid(nid1, "BCBBL", nvarid) 91 ierr = nf90_get_var(nid1, nvarid, & 92 lmt_bcbbl_glo, debut, epais) 93 IF (ierr .NE. nf90_noerr) THEN 94 94 PRINT*, 'Pb de lecture pour les sources BC low' 95 95 CALL exit(1) … … 98 98 ! High BC emissions from biomass burning 99 99 ! 100 ierr = NF_INQ_VARID(nid1, "BCBBH", nvarid)101 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &102 lmt_bcbbh_glo )103 IF (ierr .NE. NF_NOERR) THEN100 ierr = nf90_inq_varid(nid1, "BCBBH", nvarid) 101 ierr = nf90_get_var(nid1, nvarid, & 102 lmt_bcbbh_glo, debut, epais) 103 IF (ierr .NE. nf90_noerr) THEN 104 104 PRINT*, 'Pb de lecture pour les sources BC high' 105 105 CALL exit(1) … … 108 108 ! BC emissions from ship transport 109 109 ! 110 ierr = NF_INQ_VARID(nid1, "BCBA", nvarid)111 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &112 lmt_bcba_glo )113 IF (ierr .NE. NF_NOERR) THEN110 ierr = nf90_inq_varid(nid1, "BCBA", nvarid) 111 ierr = nf90_get_var(nid1, nvarid, & 112 lmt_bcba_glo, debut, epais) 113 IF (ierr .NE. nf90_noerr) THEN 114 114 PRINT*, 'Pb de lecture pour les sources BC' 115 115 CALL exit(1) … … 124 124 ! OM emissions from fossil fuel combustion 125 125 ! 126 ierr = NF_INQ_VARID(nid1, "OMFF", nvarid)127 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &128 lmt_omff_glo )129 IF (ierr .NE. NF_NOERR) THEN126 ierr = nf90_inq_varid(nid1, "OMFF", nvarid) 127 ierr = nf90_get_var(nid1, nvarid, & 128 lmt_omff_glo, debut, epais) 129 IF (ierr .NE. nf90_noerr) THEN 130 130 PRINT*, 'Pb de lecture pour les sources OM' 131 131 CALL exit(1) … … 134 134 ! OM emissions from non fossil fuel combustion 135 135 ! 136 ierr = NF_INQ_VARID(nid1, "OMNFF", nvarid)137 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &138 lmt_omnff_glo )139 IF (ierr .NE. NF_NOERR) THEN136 ierr = nf90_inq_varid(nid1, "OMNFF", nvarid) 137 ierr = nf90_get_var(nid1, nvarid, & 138 lmt_omnff_glo, debut, epais) 139 IF (ierr .NE. nf90_noerr) THEN 140 140 PRINT*, 'Pb de lecture pour les sources OM' 141 141 CALL exit(1) … … 144 144 ! Low OM emissions from biomass burning - low 145 145 ! 146 ierr = NF_INQ_VARID(nid1, "OMBBL", nvarid)147 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &148 lmt_ombbl_glo )149 IF (ierr .NE. NF_NOERR) THEN146 ierr = nf90_inq_varid(nid1, "OMBBL", nvarid) 147 ierr = nf90_get_var(nid1, nvarid, & 148 lmt_ombbl_glo, debut, epais) 149 IF (ierr .NE. nf90_noerr) THEN 150 150 PRINT*, 'Pb de lecture pour les sources OM low' 151 151 CALL exit(1) … … 154 154 ! High OM emissions from biomass burning - high 155 155 ! 156 ierr = NF_INQ_VARID(nid1, "OMBBH", nvarid)157 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &158 lmt_ombbh_glo )159 IF (ierr .NE. NF_NOERR) THEN156 ierr = nf90_inq_varid(nid1, "OMBBH", nvarid) 157 ierr = nf90_get_var(nid1, nvarid, & 158 lmt_ombbh_glo, debut, epais) 159 IF (ierr .NE. nf90_noerr) THEN 160 160 PRINT*, 'Pb de lecture pour les sources OM high' 161 161 CALL exit(1) … … 164 164 ! High OM emissions from ship 165 165 ! 166 ierr = NF_INQ_VARID(nid1, "OMBA", nvarid)167 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &168 lmt_omba_glo )169 IF (ierr .NE. NF_NOERR) THEN166 ierr = nf90_inq_varid(nid1, "OMBA", nvarid) 167 ierr = nf90_get_var(nid1, nvarid, & 168 lmt_omba_glo, debut, epais) 169 IF (ierr .NE. nf90_noerr) THEN 170 170 PRINT*, 'Pb de lecture pour les sources OM ship' 171 171 CALL exit(1) … … 174 174 ! Natural Terpene emissions => Natural OM emissions 175 175 ! 176 ierr = NF_INQ_VARID(nid1, "TERP", nvarid)177 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, &178 lmt_terp_glo )179 IF (ierr .NE. NF_NOERR) THEN176 ierr = nf90_inq_varid(nid1, "TERP", nvarid) 177 ierr = nf90_get_var(nid1, nvarid, & 178 lmt_terp_glo, debut, epais) 179 IF (ierr .NE. nf90_noerr) THEN 180 180 PRINT*, 'Pb de lecture pour les sources Terpene' 181 181 CALL exit(1) … … 186 186 ENDDO 187 187 188 ierr = NF_CLOSE(nid1)188 ierr = nf90_close(nid1) 189 189 ! 190 190 PRINT*, 'Carbon sources lues pour jour: ', jour -
LMDZ6/trunk/libf/phylmd/Dust/condsurfs.f90
r5246 r5270 4 4 lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc) 5 5 USE dimphy 6 USE netcdf, ONLY: nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, & 7 nf90_nowrite, nf90_get_var 6 8 IMPLICIT none 7 9 ! … … 10 12 ! 11 13 INCLUDE "dimensions.h" 12 INCLUDE "netcdf.inc"13 14 ! 14 15 REAL :: lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon) … … 34 35 ENDIF 35 36 ! 36 ierr = NF_OPEN ("limitsoufre.nc", NF_NOWRITE, nid)37 if (ierr.ne. NF_NOERR) then37 ierr = nf90_open ("limitsoufre.nc", nf90_nowrite, nid) 38 if (ierr.ne.nf90_noerr) then 38 39 write(6,*)' Pb d''ouverture du fichier limitsoufre.nc' 39 40 write(6,*)' ierr = ', ierr … … 47 48 epais(2) = 1 48 49 ! 49 ierr = NF_INQ_VARID(nid, "VOLC", nvarid)50 !nhl #ifdef NC_DOUBLE 51 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2volc)52 !nhl #else 53 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2volc)54 !nhl #endif 55 IF (ierr .NE. NF_NOERR) THEN50 ierr = nf90_inq_varid(nid, "VOLC", nvarid) 51 !nhl #ifdef NC_DOUBLE 52 ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais) 53 !nhl #else 54 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais) 55 !nhl #endif 56 IF (ierr .NE. nf90_noerr) THEN 56 57 PRINT*, 'Pb de lecture pour les sources so2 volcan' 57 58 CALL exit(1) 58 59 ENDIF 59 60 ! 60 ierr = NF_INQ_VARID(nid, "ALTI", nvarid)61 !nhl #ifdef NC_DOUBLE 62 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_altvolc)63 !nhl #else 64 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_altvolc)65 !nhl #endif 66 IF (ierr .NE. NF_NOERR) THEN61 ierr = nf90_inq_varid(nid, "ALTI", nvarid) 62 !nhl #ifdef NC_DOUBLE 63 ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais) 64 !nhl #else 65 !nhl ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais) 66 !nhl #endif 67 IF (ierr .NE. nf90_noerr) THEN 67 68 PRINT*, 'Pb de lecture pour les altitudes volcan' 68 69 CALL exit(1) … … 71 72 IF (edgar) THEN !--EDGAR w/o ship and biomass burning 72 73 ! 73 ierr = NF_INQ_VARID(nid, "SO2ED95L", nvarid)74 !nhl #ifdef NC_DOUBLE 75 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b)76 !nhl #else 77 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b)78 !nhl #endif 79 IF (ierr .NE. NF_NOERR) THEN74 ierr = nf90_inq_varid(nid, "SO2ED95L", nvarid) 75 !nhl #ifdef NC_DOUBLE 76 ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 77 !nhl #else 78 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 79 !nhl #endif 80 IF (ierr .NE. nf90_noerr) THEN 80 81 PRINT*, 'Pb de lecture pour les sources so2 edgar low' 81 82 CALL exit(1) 82 83 ENDIF 83 84 ! 84 ierr = NF_INQ_VARID(nid, "SO2ED95H", nvarid)85 !nhl #ifdef NC_DOUBLE 86 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h)87 !nhl #else 88 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h)89 !nhl #endif 90 IF (ierr .NE. NF_NOERR) THEN85 ierr = nf90_inq_varid(nid, "SO2ED95H", nvarid) 86 !nhl #ifdef NC_DOUBLE 87 ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 88 !nhl #else 89 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 90 !nhl #endif 91 IF (ierr .NE. nf90_noerr) THEN 91 92 PRINT*, 'Pb de lecture pour les sources so2 edgar high' 92 93 CALL exit(1) … … 95 96 ELSE !--GEIA 96 97 ! 97 ierr = NF_INQ_VARID(nid, "SO2H", nvarid)98 !nhl #ifdef NC_DOUBLE 99 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h)100 !nhl #else 101 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h)102 !nhl #endif 103 IF (ierr .NE. NF_NOERR) THEN98 ierr = nf90_inq_varid(nid, "SO2H", nvarid) 99 !nhl #ifdef NC_DOUBLE 100 ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 101 !nhl #else 102 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 103 !nhl #endif 104 IF (ierr .NE. nf90_noerr) THEN 104 105 PRINT*, 'Pb de lecture pour les sources so2 haut' 105 106 CALL exit(1) 106 107 ENDIF 107 108 ! 108 ierr = NF_INQ_VARID(nid, "SO2B", nvarid)109 !nhl #ifdef NC_DOUBLE 110 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b)111 !nhl #else 112 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b)113 !nhl #endif 114 IF (ierr .NE. NF_NOERR) THEN109 ierr = nf90_inq_varid(nid, "SO2B", nvarid) 110 !nhl #ifdef NC_DOUBLE 111 ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 112 !nhl #else 113 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 114 !nhl #endif 115 IF (ierr .NE. nf90_noerr) THEN 115 116 PRINT*, 'Pb de lecture pour les sources so2 bas' 116 117 CALL exit(1) … … 119 120 ENDIF !--edgar 120 121 ! 121 ierr = NF_INQ_VARID(nid, "SO2BB", nvarid)122 !nhl #ifdef NC_DOUBLE 123 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2bb)124 !nhl #else 125 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2bb)126 !nhl #endif 127 IF (ierr .NE. NF_NOERR) THEN122 ierr = nf90_inq_varid(nid, "SO2BB", nvarid) 123 !nhl #ifdef NC_DOUBLE 124 ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais) 125 !nhl #else 126 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais) 127 !nhl #endif 128 IF (ierr .NE. nf90_noerr) THEN 128 129 PRINT*, 'Pb de lecture pour les sources so2 bb' 129 130 CALL exit(1) 130 131 ENDIF 131 132 ! 132 ierr = NF_INQ_VARID(nid, "SO2BA", nvarid)133 !nhl #ifdef NC_DOUBLE 134 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2ba)135 !nhl #else 136 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2ba)137 !nhl #endif 138 IF (ierr .NE. NF_NOERR) THEN133 ierr = nf90_inq_varid(nid, "SO2BA", nvarid) 134 !nhl #ifdef NC_DOUBLE 135 ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais) 136 !nhl #else 137 !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais) 138 !nhl #endif 139 IF (ierr .NE. nf90_noerr) THEN 139 140 PRINT*, 'Pb de lecture pour les sources so2 bateau' 140 141 CALL exit(1) 141 142 ENDIF 142 143 ! 143 ierr = NF_INQ_VARID(nid, "DMSB", nvarid)144 !nhl #ifdef NC_DOUBLE 145 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dmsbio)146 !nhl #else 147 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsbio)148 !nhl #endif 149 IF (ierr .NE. NF_NOERR) THEN144 ierr = nf90_inq_varid(nid, "DMSB", nvarid) 145 !nhl #ifdef NC_DOUBLE 146 ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais) 147 !nhl #else 148 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais) 149 !nhl #endif 150 IF (ierr .NE. nf90_noerr) THEN 150 151 PRINT*, 'Pb de lecture pour les sources dms bio' 151 152 CALL exit(1) 152 153 ENDIF 153 154 ! 154 ierr = NF_INQ_VARID(nid, "H2SB", nvarid)155 !nhl #ifdef NC_DOUBLE 156 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_h2sbio)157 !nhl #else 158 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_h2sbio)159 !nhl #endif 160 IF (ierr .NE. NF_NOERR) THEN155 ierr = nf90_inq_varid(nid, "H2SB", nvarid) 156 !nhl #ifdef NC_DOUBLE 157 ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais) 158 !nhl #else 159 !nhl ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais) 160 !nhl #endif 161 IF (ierr .NE. nf90_noerr) THEN 161 162 PRINT*, 'Pb de lecture pour les sources h2s bio' 162 163 CALL exit(1) … … 165 166 IF (flag_dms.EQ.1) THEN 166 167 ! 167 ierr = NF_INQ_VARID(nid, "DMSL", nvarid)168 !nhl #ifdef NC_DOUBLE 169 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms)170 !nhl #else 171 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms)172 !nhl #endif 173 IF (ierr .NE. NF_NOERR) THEN168 ierr = nf90_inq_varid(nid, "DMSL", nvarid) 169 !nhl #ifdef NC_DOUBLE 170 ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 171 !nhl #else 172 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 173 !nhl #endif 174 IF (ierr .NE. nf90_noerr) THEN 174 175 PRINT*, 'Pb de lecture pour les sources dms liss' 175 176 CALL exit(1) … … 178 179 ELSEIF (flag_dms.EQ.2) THEN 179 180 ! 180 ierr = NF_INQ_VARID(nid, "DMSW", nvarid)181 !nhl #ifdef NC_DOUBLE 182 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms)183 !nhl #else 184 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms)185 !nhl #endif 186 IF (ierr .NE. NF_NOERR) THEN181 ierr = nf90_inq_varid(nid, "DMSW", nvarid) 182 !nhl #ifdef NC_DOUBLE 183 ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 184 !nhl #else 185 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 186 !nhl #endif 187 IF (ierr .NE. nf90_noerr) THEN 187 188 PRINT*, 'Pb de lecture pour les sources dms wann' 188 189 CALL exit(1) … … 191 192 ELSEIF (flag_dms.EQ.3) THEN 192 193 ! 193 ierr = NF_INQ_VARID(nid, "DMSC1", nvarid)194 !nhl #ifdef NC_DOUBLE 195 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)196 !nhl #else 197 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)198 !nhl #endif 199 IF (ierr .NE. NF_NOERR) THEN194 ierr = nf90_inq_varid(nid, "DMSC1", nvarid) 195 !nhl #ifdef NC_DOUBLE 196 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 197 !nhl #else 198 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 199 !nhl #endif 200 IF (ierr .NE. nf90_noerr) THEN 200 201 PRINT*, 'Pb de lecture pour les sources dmsconc old' 201 202 CALL exit(1) … … 204 205 ELSEIF (flag_dms.EQ.4) THEN 205 206 ! 206 ierr = NF_INQ_VARID(nid, "DMSC2", nvarid)207 !nhl #ifdef NC_DOUBLE 208 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)209 !nhl #else 210 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)211 !nhl #endif 212 IF (ierr .NE. NF_NOERR) THEN207 ierr = nf90_inq_varid(nid, "DMSC2", nvarid) 208 !nhl #ifdef NC_DOUBLE 209 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 210 !nhl #else 211 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 212 !nhl #endif 213 IF (ierr .NE. nf90_noerr) THEN 213 214 PRINT*, 'Pb de lecture pour les sources dms conc 2' 214 215 CALL exit(1) … … 217 218 ELSEIF (flag_dms.EQ.5) THEN 218 219 ! 219 ierr = NF_INQ_VARID(nid, "DMSC3", nvarid)220 !nhl #ifdef NC_DOUBLE 221 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)222 !nhl #else 223 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)224 !nhl #endif 225 IF (ierr .NE. NF_NOERR) THEN220 ierr = nf90_inq_varid(nid, "DMSC3", nvarid) 221 !nhl #ifdef NC_DOUBLE 222 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 223 !nhl #else 224 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 225 !nhl #endif 226 IF (ierr .NE. nf90_noerr) THEN 226 227 PRINT*, 'Pb de lecture pour les sources dms conc 3' 227 228 CALL exit(1) … … 230 231 ELSEIF (flag_dms.EQ.6) THEN 231 232 ! 232 ierr = NF_INQ_VARID(nid, "DMSC4", nvarid)233 !nhl #ifdef NC_DOUBLE 234 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)235 !nhl #else 236 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)237 !nhl #endif 238 IF (ierr .NE. NF_NOERR) THEN233 ierr = nf90_inq_varid(nid, "DMSC4", nvarid) 234 !nhl #ifdef NC_DOUBLE 235 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 236 !nhl #else 237 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 238 !nhl #endif 239 IF (ierr .NE. nf90_noerr) THEN 239 240 PRINT*, 'Pb de lecture pour les sources dms conc 4' 240 241 CALL exit(1) … … 243 244 ELSEIF (flag_dms.EQ.7) THEN 244 245 ! 245 ierr = NF_INQ_VARID(nid, "DMSC5", nvarid)246 !nhl #ifdef NC_DOUBLE 247 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)248 !nhl #else 249 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)250 !nhl #endif 251 IF (ierr .NE. NF_NOERR) THEN246 ierr = nf90_inq_varid(nid, "DMSC5", nvarid) 247 !nhl #ifdef NC_DOUBLE 248 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 249 !nhl #else 250 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 251 !nhl #endif 252 IF (ierr .NE. nf90_noerr) THEN 252 253 PRINT*, 'Pb de lecture pour les sources dms conc 5' 253 254 CALL exit(1) … … 256 257 ELSEIF (flag_dms.EQ.8) THEN 257 258 ! 258 ierr = NF_INQ_VARID(nid, "DMSC6", nvarid)259 !nhl #ifdef NC_DOUBLE 260 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)261 !nhl #else 262 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)263 !nhl #endif 264 IF (ierr .NE. NF_NOERR) THEN259 ierr = nf90_inq_varid(nid, "DMSC6", nvarid) 260 !nhl #ifdef NC_DOUBLE 261 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 262 !nhl #else 263 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 264 !nhl #endif 265 IF (ierr .NE. nf90_noerr) THEN 265 266 PRINT*, 'Pb de lecture pour les sources dms conc 6' 266 267 CALL exit(1) … … 269 270 ELSEIF (flag_dms.EQ.9) THEN 270 271 ! 271 ierr = NF_INQ_VARID(nid, "DMSC7", nvarid)272 !nhl #ifdef NC_DOUBLE 273 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)274 !nhl #else 275 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)276 !nhl #endif 277 IF (ierr .NE. NF_NOERR) THEN272 ierr = nf90_inq_varid(nid, "DMSC7", nvarid) 273 !nhl #ifdef NC_DOUBLE 274 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 275 !nhl #else 276 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 277 !nhl #endif 278 IF (ierr .NE. nf90_noerr) THEN 278 279 PRINT*, 'Pb de lecture pour les sources dms conc 7' 279 280 CALL exit(1) … … 282 283 ELSEIF (flag_dms.EQ.10) THEN 283 284 ! 284 ierr = NF_INQ_VARID(nid, "DMSC8", nvarid)285 !nhl #ifdef NC_DOUBLE 286 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc)287 !nhl #else 288 !nhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc)289 !nhl #endif 290 IF (ierr .NE. NF_NOERR) THEN285 ierr = nf90_inq_varid(nid, "DMSC8", nvarid) 286 !nhl #ifdef NC_DOUBLE 287 ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) 288 !nhl #else 289 !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 290 !nhl #endif 291 IF (ierr .NE. nf90_noerr) THEN 291 292 PRINT*, 'Pb de lecture pour les sources dms conc 8' 292 293 CALL exit(1) … … 300 301 ENDIF 301 302 ! 302 ierr = NF_CLOSE(nid)303 ierr = nf90_close(nid) 303 304 ! 304 305 IF (flag_dms.LE.2) THEN -
LMDZ6/trunk/libf/phylmd/Dust/condsurfs_new.f90
r5246 r5270 9 9 USE mod_phys_lmdz_para 10 10 USE dimphy 11 USE netcdf, ONLY: nf90_get_var, nf90_inq_varid, nf90_close, nf90_noerr, nf90_open, nf90_nowrite 11 12 IMPLICIT none 12 13 ! … … 15 16 ! 16 17 INCLUDE "dimensions.h" 17 INCLUDE "netcdf.inc"18 18 ! 19 19 REAL :: lmt_so2b(klon), lmt_so2h(klon), lmt_so2nff(klon) … … 61 61 !======================================================================= 62 62 ! 63 ierr = NF_OPEN ("sulphur_emissions_antro.nc", NF_NOWRITE, nid)64 if (ierr.ne. NF_NOERR) then63 ierr = nf90_open ("sulphur_emissions_antro.nc", nf90_nowrite, nid) 64 if (ierr.ne.nf90_noerr) then 65 65 write(6,*)' Pb d''ouverture du fichier sulphur_emissions_antro' 66 66 write(6,*)' ierr = ', ierr … … 71 71 ! SO2 Low level emissions 72 72 ! 73 ierr = NF_INQ_VARID(nid, "SO2FF_LOW", nvarid)74 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais,lmt_so2b_glo)75 IF (ierr .NE. NF_NOERR) THEN73 ierr = nf90_inq_varid(nid, "SO2FF_LOW", nvarid) 74 ierr = nf90_get_var(nid, nvarid,lmt_so2b_glo, debut, epais) 75 IF (ierr .NE. nf90_noerr) THEN 76 76 PRINT*, 'Pb de lecture pour les sources so2 low' 77 77 print *,'JE klon, jour, debut ,epais ',klon_glo,jour,debut,epais … … 83 83 ! SO2 High level emissions 84 84 ! 85 ierr = NF_INQ_VARID(nid, "SO2FF_HIGH", nvarid)86 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais,lmt_so2h_glo)87 IF (ierr .NE. NF_NOERR) THEN85 ierr = nf90_inq_varid(nid, "SO2FF_HIGH", nvarid) 86 ierr = nf90_get_var(nid, nvarid,lmt_so2h_glo, debut, epais) 87 IF (ierr .NE. nf90_noerr) THEN 88 88 PRINT*, 'Pb de lecture pour les sources so2 high' 89 89 CALL exit(1) … … 92 92 ! SO2 Biomass burning High level emissions 93 93 ! 94 ierr = NF_INQ_VARID(nid, "SO2BBH", nvarid)95 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, &96 epais , lmt_so2bb_h_glo)97 IF (ierr .NE. NF_NOERR) THEN94 ierr = nf90_inq_varid(nid, "SO2BBH", nvarid) 95 ierr = nf90_get_var(nid, nvarid, lmt_so2bb_h_glo, debut, & 96 epais) 97 IF (ierr .NE. nf90_noerr) THEN 98 98 PRINT*, 'Pb de lecture pour les sources so2 BB high' 99 99 CALL exit(1) … … 102 102 ! SO2 biomass burning low level emissions 103 103 ! 104 ierr = NF_INQ_VARID(nid, "SO2BBL", nvarid)105 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, &106 epais , lmt_so2bb_l_glo)107 IF (ierr .NE. NF_NOERR) THEN104 ierr = nf90_inq_varid(nid, "SO2BBL", nvarid) 105 ierr = nf90_get_var(nid, nvarid, lmt_so2bb_l_glo, debut, & 106 epais) 107 IF (ierr .NE. nf90_noerr) THEN 108 108 PRINT*, 'Pb de lecture pour les sources so2 BB low' 109 109 CALL exit(1) … … 112 112 ! SO2 ship emissions 113 113 ! 114 ierr = NF_INQ_VARID(nid, "SO2BA", nvarid)115 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_so2ba_glo)116 IF (ierr .NE. NF_NOERR) THEN114 ierr = nf90_inq_varid(nid, "SO2BA", nvarid) 115 ierr = nf90_get_var(nid, nvarid,lmt_so2ba_glo, debut,epais) 116 IF (ierr .NE. nf90_noerr) THEN 117 117 PRINT*, 'Pb de lecture pour les sources so2 ship' 118 118 CALL exit(1) … … 121 121 ! SO2 Non Fossil Fuel Emissions 122 122 ! 123 ierr = NF_INQ_VARID(nid, "SO2NFF", nvarid)124 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, &125 lmt_so2nff_glo )126 IF (ierr .NE. NF_NOERR) THEN123 ierr = nf90_inq_varid(nid, "SO2NFF", nvarid) 124 ierr = nf90_get_var(nid, nvarid, & 125 lmt_so2nff_glo, debut, epais) 126 IF (ierr .NE. nf90_noerr) THEN 127 127 PRINT*, 'Pb de lecture pour les sources so2 non FF' 128 128 CALL exit(1) 129 129 ENDIF 130 130 ! 131 ierr = NF_CLOSE(nid)131 ierr = nf90_close(nid) 132 132 ! 133 133 !======================================================================= 134 134 ! READING NATURAL EMISSIONS 135 135 !======================================================================= 136 ierr = NF_OPEN ("sulphur_emissions_nat.nc", NF_NOWRITE, nid)137 if (ierr.ne. NF_NOERR) then136 ierr = nf90_open ("sulphur_emissions_nat.nc", nf90_nowrite, nid) 137 if (ierr.ne.nf90_noerr) then 138 138 write(6,*)' Pb d''ouverture du fichier sulphur_emissions_nat' 139 139 write(6,*)' ierr = ', ierr … … 143 143 ! Biologenic source of DMS 144 144 ! 145 ierr = NF_INQ_VARID(nid, "DMSB", nvarid)146 ierr = NF_GET_VARA_DOUBLE (nid, nvarid,debut,epais,lmt_dmsbio_glo)147 IF (ierr .NE. NF_NOERR) THEN145 ierr = nf90_inq_varid(nid, "DMSB", nvarid) 146 ierr = nf90_get_var(nid, nvarid,lmt_dmsbio_glo,debut,epais) 147 IF (ierr .NE. nf90_noerr) THEN 148 148 PRINT*, 'Pb de lecture pour les sources dms bio' 149 149 CALL exit(1) … … 152 152 ! Biologenic source of H2S 153 153 ! 154 ierr = NF_INQ_VARID(nid, "H2SB", nvarid)155 ierr = NF_GET_VARA_DOUBLE (nid, nvarid,debut,epais,lmt_h2sbio_glo)156 IF (ierr .NE. NF_NOERR) THEN154 ierr = nf90_inq_varid(nid, "H2SB", nvarid) 155 ierr = nf90_get_var(nid, nvarid,lmt_h2sbio_glo,debut,epais) 156 IF (ierr .NE. nf90_noerr) THEN 157 157 PRINT*, 'Pb de lecture pour les sources h2s bio' 158 158 CALL exit(1) … … 163 163 IF (flag_dms.EQ.4) THEN 164 164 ! 165 ierr = NF_INQ_VARID(nid, "DMSC2", nvarid)166 ierr = NF_GET_VARA_DOUBLE (nid,nvarid,debut,epais,lmt_dmsconc_glo)167 IF (ierr .NE. NF_NOERR) THEN165 ierr = nf90_inq_varid(nid, "DMSC2", nvarid) 166 ierr = nf90_get_var(nid,nvarid,lmt_dmsconc_glo,debut,epais) 167 IF (ierr .NE. nf90_noerr) THEN 168 168 PRINT*, 'Pb de lecture pour les sources dms conc 2' 169 169 CALL exit(1) … … 182 182 ENDIF 183 183 ! 184 ierr = NF_CLOSE(nid)184 ierr = nf90_close(nid) 185 185 ! 186 186 !======================================================================= … … 189 189 print *,' *** READING VOLCANIC EMISSIONS *** ' 190 190 print *,' Jour = ',jour 191 ierr = NF_OPEN ("sulphur_emissions_volc.nc", NF_NOWRITE, nid)192 if (ierr.ne. NF_NOERR) then191 ierr = nf90_open ("sulphur_emissions_volc.nc", nf90_nowrite, nid) 192 if (ierr.ne.nf90_noerr) then 193 193 write(6,*)' Pb d''ouverture du fichier sulphur_emissions_volc' 194 194 write(6,*)' ierr = ', ierr … … 198 198 ! Continuous Volcanic emissions 199 199 ! 200 ! ierr = NF_INQ_VARID(nid, "VOLC", nvarid)201 ierr = NF_INQ_VARID(nid, "flx_volc_cont", nvarid)202 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, &203 lmt_so2volc_cont_glo )204 IF (ierr .NE. NF_NOERR) THEN200 ! ierr = nf90_inq_varid(nid, "VOLC", nvarid) 201 ierr = nf90_inq_varid(nid, "flx_volc_cont", nvarid) 202 ierr = nf90_get_var(nid, nvarid, & 203 lmt_so2volc_cont_glo, debut, epais) 204 IF (ierr .NE. nf90_noerr) THEN 205 205 PRINT*, 'Pb de lecture pour les sources so2 volcan (cont)' 206 206 CALL exit(1) … … 212 212 ! Altitud of continuous volcanic emissions 213 213 ! 214 ! ierr = NF_INQ_VARID(nid, "ALTI", nvarid)215 ierr = NF_INQ_VARID(nid, "flx_volc_altcont", nvarid)216 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, &217 lmt_altvolc_cont_glo )218 IF (ierr .NE. NF_NOERR) THEN214 ! ierr = nf90_inq_varid(nid, "ALTI", nvarid) 215 ierr = nf90_inq_varid(nid, "flx_volc_altcont", nvarid) 216 ierr = nf90_get_var(nid, nvarid, & 217 lmt_altvolc_cont_glo, debut, epais) 218 IF (ierr .NE. nf90_noerr) THEN 219 219 PRINT*, 'Pb de lecture pour les altitudes volcan (cont)' 220 220 CALL exit(1) … … 223 223 ! Explosive Volcanic emissions 224 224 ! 225 ierr = NF_INQ_VARID(nid, "flx_volc_expl", nvarid)226 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, &227 lmt_so2volc_expl_glo )228 IF (ierr .NE. NF_NOERR) THEN225 ierr = nf90_inq_varid(nid, "flx_volc_expl", nvarid) 226 ierr = nf90_get_var(nid, nvarid, & 227 lmt_so2volc_expl_glo, debut, epais) 228 IF (ierr .NE. nf90_noerr) THEN 229 229 PRINT*, 'Pb de lecture pour les sources so2 volcan (expl)' 230 230 CALL exit(1) … … 236 236 ! Altitud of explosive volcanic emissions 237 237 ! 238 ierr = NF_INQ_VARID(nid, "flx_volc_altexpl", nvarid)239 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, &240 lmt_altvolc_expl_glo )241 IF (ierr .NE. NF_NOERR) THEN238 ierr = nf90_inq_varid(nid, "flx_volc_altexpl", nvarid) 239 ierr = nf90_get_var(nid, nvarid, & 240 lmt_altvolc_expl_glo, debut, epais) 241 IF (ierr .NE. nf90_noerr) THEN 242 242 PRINT*, 'Pb de lecture pour les altitudes volcan' 243 243 CALL exit(1) … … 245 245 ! lmt_altvolc_expl(:)=0.0 246 246 247 ierr = NF_CLOSE(nid)247 ierr = nf90_close(nid) 248 248 ! 249 249 PRINT*, 'Sources SOUFRE lues pour jour: ', jour -
LMDZ6/trunk/libf/phylmd/Dust/phytracr_spl_mod.F90
r5233 r5270 4568 4568 USE mod_grid_phy_lmdz 4569 4569 USE mod_phys_lmdz_para 4570 USE netcdf, ONLY: nf90_open, nf90_close, nf90_inq_varid, nf90_nowrite, nf90_noerr, nf90_get_var 4570 4571 IMPLICIT NONE 4571 4572 include "netcdf.inc"4573 4572 4574 4573 CHARACTER*800 filescaleparams … … 4581 4580 integer start(4),count(4), status 4582 4581 ! local 4583 integer debutread,countread4584 4582 CHARACTER*104 varname 4585 4583 CHARACTER*2 aux_2s … … 4587 4585 !$OMP MASTER 4588 4586 IF (is_mpi_root .AND. is_omp_root) THEN 4589 !nci=NCOPN(trim(adjustl(filescaleparams)),NCNOWRIT,rcode) 4590 ierr = NF_OPEN (trim(adjustl(filescaleparams)),NF_NOWRITE, nid) 4591 if (ierr .EQ. NF_NOERR) THEN 4592 debutread=step_sca 4593 countread=1 4587 !nci=nf90_open(trim(adjustl(filescaleparams)),nf90_nowrite,rcode) 4588 ierr = nf90_open (trim(adjustl(filescaleparams)),nf90_nowrite, nid) 4589 if (ierr .EQ. nf90_noerr) THEN 4594 4590 4595 4591 do i=1,nbreg … … 4597 4593 varname= trim(adjustl(paramname))//aux_2s 4598 4594 print *,varname 4599 ierr = NF_INQ_VARID (nid,trim(adjustl(varname)), nvarid) 4600 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debutread, & 4601 countread, auxreal) 4602 IF (ierr .NE. NF_NOERR) THEN 4595 ierr = nf90_inq_varid(nid,trim(adjustl(varname)), nvarid) 4596 ierr = nf90_get_var(nid, nvarid, auxreal, [step_sca]) 4597 IF (ierr .NE. nf90_noerr) THEN 4603 4598 PRINT*, 'Pb de lecture pour modvalues' 4604 4599 print *,'JE scale_var, step_sca',trim(adjustl(varname)),step_sca … … 4613 4608 enddo 4614 4609 4615 ierr = NF_CLOSE(nid)4610 ierr = nf90_close(nid) 4616 4611 else 4617 4612 print *,'File '//trim(adjustl(filescaleparams))//' not found' -
LMDZ6/trunk/libf/phylmd/Dust/read_dust.f90
r5268 r5270 3 3 USE mod_grid_phy_lmdz 4 4 USE mod_phys_lmdz_para 5 USE netcdf, ONLY: nf90_get_var 5 USE netcdf, ONLY: nf90_get_var, nf90_nowrite, nf90_open, nf90_inq_varid 6 6 IMPLICIT NONE 7 7 ! 8 8 INCLUDE "dimensions.h" 9 9 INCLUDE "paramet.h" 10 INCLUDE "netcdf.inc"11 10 ! 12 11 INTEGER :: step, nbjour … … 17 16 ! as real dust_nc(iip1,jjp1) 18 17 real :: dust_nc_glo(nbp_lon+1,nbp_lat) 19 real :: rcode 20 integer :: ncid1, varid1, ncid2, varid2 18 INTEGER :: ncid1, varid1, ncid2, varid2, rcode 21 19 22 20 save ncid1, varid1, ncid2, varid2 … … 29 27 if (debutphy) then 30 28 ! 31 ncid1= NCOPN('dust.nc',NCNOWRIT,rcode)32 varid1= NCVID(ncid1,'EMISSION',rcode)29 ncid1=nf90_open('dust.nc',nf90_nowrite,rcode) 30 varid1=nf90_inq_varid(ncid1,'EMISSION',rcode) 33 31 ! 34 32 endif -
LMDZ6/trunk/libf/phylmd/Dust/read_surface.f90
r5268 r5270 10 10 USE mod_phys_lmdz_para 11 11 USE iophy 12 USE netcdf, ONLY: nf90_ get_var12 USE netcdf, ONLY: nf90_inq_varid,nf90_noerr,nf90_get_var,nf90_nowrite,nf90_inq_varid,nf90_open 13 13 IMPLICIT NONE 14 15 INCLUDE "netcdf.inc"16 14 INCLUDE "dimensions.h" 17 15 INCLUDE "paramet.h" … … 31 29 real surfa_glo(klon_glo,5) 32 30 ! 33 integer ncid 34 integer varid 35 real rcode 31 integer ncid, varid, rcode 36 32 integer start(2),count(2),status 37 33 integer i,j,l,ig … … 43 39 real, dimension(jjp1) :: lats 44 40 real, dimension(nbp_lat) :: lats_glo 45 real :: rcode246 41 integer, dimension(1) :: startj,endj 47 42 !JE20140526>> … … 50 45 51 46 print*,'Lecture du fichier donnees_lisa.nc' 52 ncid= NCOPN('donnees_lisa.nc',NCNOWRIT,rcode)47 ncid=nf90_open('donnees_lisa.nc',nf90_nowrite,rcode) 53 48 54 49 !JE20140526<<: check if are inversed or not the latitude grid in donnes_lisa … … 62 57 if (i==4) aux4s='Latu' 63 58 if (i==5) aux4s='latU' 64 status = NF_INQ_VARID(ncid, aux4s, rcode)59 status = nf90_inq_varid(ncid, aux4s, rcode) 65 60 ! print *,'stat,i',status,i,outcycle,aux4s 66 ! print *,'ifclause',status.NE. NF_NOERR,outcycle == .false.67 IF ((.not.(status.NE. NF_NOERR) ).and.( .not. outcycle )) THEN61 ! print *,'ifclause',status.NE. nf90_noerr ,outcycle == .false. 62 IF ((.not.(status.NE. nf90_noerr) ).and.( .not. outcycle )) THEN 68 63 outcycle=.true. 69 64 latstr=aux4s … … 73 68 ! endj(1)=jjp1 74 69 endj(1)=nbp_lat 75 varid= NCVID(ncid,latstr,rcode)70 varid=nf90_inq_varid(ncid,latstr,rcode) 76 71 77 72 status = nf90_get_var(ncid, varid, lats_glo, startj, endj) 78 73 ! print *,latstr,varid,status,jjp1,rcode 79 ! IF (status .NE. NF_NOERR) print*,'NOOOOOOO'74 ! IF (status .NE. nf90_noerr) print*,'NOOOOOOO' 80 75 ! print *,lats 81 76 !stop … … 90 85 varname=trim(name)//str1 91 86 print*,'lecture variable:',varname 92 varid= NCVID(ncid,trim(varname),rcode)93 ! varid= NCVID(ncid,varname,rcode)87 varid=nf90_inq_varid(ncid,trim(varname),rcode) 88 ! varid=nf90_inq_varid(ncid,varname,rcode) 94 89 95 90 ! dimensions pour les champs scalaires et le vent zonal -
LMDZ6/trunk/libf/phylmd/Dust/read_vent.f90
r5268 r5270 3 3 USE mod_grid_phy_lmdz 4 4 USE mod_phys_lmdz_para 5 USE netcdf, ONLY: nf90_get_var 5 USE netcdf, ONLY: nf90_get_var, nf90_open, nf90_inq_varid, nf90_nowrite 6 6 ! USE write_field_phy 7 7 IMPLICIT NONE … … 9 9 ! INCLUDE "dimphy.h" 10 10 INCLUDE "paramet.h" 11 INCLUDE "netcdf.inc"12 11 ! 13 12 INTEGER :: step, nbjour … … 20 19 real :: u10m_nc_glo(nbp_lon+1,nbp_lat) !, v10m_nc(iip1,jjm) ! dim 97x72 21 20 real :: v10m_nc_glo(nbp_lon+1,nbp_lat) ! dim 97x73 22 real :: rcode 23 integer :: ncidu1, varidu1, ncidv1, varidv1 21 integer :: ncidu1, varidu1, ncidv1, varidv1, rcode 24 22 save ncidu1, varidu1, ncidv1, varidv1 25 23 !$OMP THREADPRIVATE(ncidu1, varidu1, ncidv1, varidv1) … … 33 31 if (debutphy) then 34 32 ! 35 ncidu1= NCOPN('u10m.nc',NCNOWRIT,rcode)36 varidu1= NCVID(ncidu1,'U10M',rcode)37 ncidv1= NCOPN('v10m.nc',NCNOWRIT,rcode)38 varidv1= NCVID(ncidv1,'V10M',rcode)33 ncidu1=nf90_open('u10m.nc',nf90_nowrite,rcode) 34 varidu1=nf90_inq_varid(ncidu1,'U10M',rcode) 35 ncidv1=nf90_open('v10m.nc',nf90_nowrite,rcode) 36 varidv1=nf90_inq_varid(ncidv1,'V10M',rcode) 39 37 ! 40 38 endif -
LMDZ6/trunk/libf/phylmd/condsurf.f90
r5268 r5270 7 7 USE indice_sol_mod 8 8 USE time_phylmdz_mod, ONLY: annee_ref 9 USE netcdf, ONLY: nf90_get_var 9 USE netcdf, ONLY: nf90_get_var,nf90_open,nf90_inq_varid,nf90_noerr,nf90_close,nf90_nowrite 10 10 IMPLICIT NONE 11 11 … … 20 20 21 21 ! lmt_bils: bilan chaleur au sol (a utiliser pour "slab-ocean") 22 23 include "netcdf.inc"24 22 INTEGER nid, nvarid 25 23 INTEGER debut(2) … … 89 87 !$OMP MASTER 90 88 IF (is_mpi_root) THEN 91 ierr = nf _open(fich, nf_nowrite, nid)92 IF (ierr/=nf _noerr) THEN89 ierr = nf90_open(fich, nf90_nowrite, nid) 90 IF (ierr/=nf90_noerr) THEN 93 91 WRITE (6, *) ' Pb d''ouverture du fichier ', fich 94 92 WRITE (6, *) ' Le fichier limit ', fich, ' (avec 4 chiffres , pour' … … 106 104 ! Bilan flux de chaleur au sol: 107 105 108 ierr = nf _inq_varid(nid, 'BILS', nvarid)109 IF (ierr/=nf _noerr) THEN106 ierr = nf90_inq_varid(nid, 'BILS', nvarid) 107 IF (ierr/=nf90_noerr) THEN 110 108 CALL abort_physic('cond_surf', 'Le champ <BILS> est absent', 1) 111 109 END IF 112 110 PRINT *, 'debut,epais', debut, epais, 'jour,jourvrai', jour, jourvrai 113 111 ierr = nf90_get_var(nid, nvarid, lmt_bils_glo, debut, epais) 114 IF (ierr/=nf _noerr) THEN112 IF (ierr/=nf90_noerr) THEN 115 113 CALL abort_physic('condsurf', 'Lecture echouee pour <BILS>', 1) 116 114 END IF … … 119 117 ! Fermer le fichier: 120 118 121 ierr = nf _close(nid)119 ierr = nf90_close(nid) 122 120 123 121 END IF ! is_mpi_root==0 -
LMDZ6/trunk/libf/phylmd/dyn1d/1DUTILS.h
r5268 r5270 678 678 include "dimensions.h" 679 679 !!#include "control.h" 680 include "netcdf.inc"681 680 682 681 ! Arguments: … … 825 824 include "dimensions.h" 826 825 !!#include "control.h" 827 include "netcdf.inc"828 826 829 827 ! Arguments: … … 864 862 865 863 ! modname = 'dyn1dredem' 866 ! ierr = NF_OPEN(fichnom, NF_WRITE, nid)867 ! IF (ierr .NE. NF_NOERR) THEN864 ! ierr = nf90_open(fichnom, nf90_write, nid) 865 ! IF (ierr .NE. nf90_noerr) THEN 868 866 ! abort_message="Pb. d ouverture "//fichnom 869 867 ! CALL abort_gcm('Modele 1D',abort_message,1) -
LMDZ6/trunk/libf/phylmd/dyn1d/1D_decl_cases.h
r5084 r5270 1 INCLUDE "netcdf.inc" 1 2 2 3 3 ! Declarations specifiques au cas Toga -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_amma_read.f90
r5268 r5270 1 1 MODULE mod_1D_amma_read 2 2 USE netcdf, ONLY: nf90_get_var, nf90_open, nf90_noerr, nf90_open, nf90_nowrite, & 3 nf90_inq_dimid, nf90_inquire_dimension, nf90_strerror, nf90_inq_varid 3 4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4 5 !Declarations specifiques au cas AMMA … … 59 60 implicit none 60 61 61 INCLUDE "netcdf.inc"62 63 62 INTEGER nid,rid,ierr 64 63 65 64 fich_amma='amma.nc' 66 65 print*,'fich_amma ',fich_amma 67 ierr = NF_OPEN(fich_amma,NF_NOWRITE,nid)68 print*,'fich_amma, NF_NOWRITE,nid ',fich_amma,NF_NOWRITE,nid69 if (ierr.NE. NF_NOERR) then66 ierr = nf90_open(fich_amma,nf90_nowrite,nid) 67 print*,'fich_amma,nf90_nowrite,nid ',fich_amma,nf90_nowrite,nid 68 if (ierr.NE.nf90_noerr) then 70 69 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 71 write(*,*) NF_STRERROR(ierr)70 write(*,*) nf90_strerror(ierr) 72 71 stop "" 73 72 endif 74 73 !....................................................................... 75 ierr= NF_INQ_DIMID(nid,'lev',rid)76 IF (ierr.NE. NF_NOERR) THEN74 ierr=nf90_inq_dimid(nid,'lev',rid) 75 IF (ierr.NE.nf90_noerr) THEN 77 76 print*, 'Oh probleme lecture dimension zz' 78 77 ENDIF 79 ierr= NF_INQ_DIMLEN(nid,rid,nlev_amma)78 ierr=nf90_inquire_dimension(nid,rid,len=nlev_amma) 80 79 print*,'OK nid,rid,nlev_amma',nid,rid,nlev_amma 81 80 !....................................................................... 82 ierr= NF_INQ_DIMID(nid,'time',rid)81 ierr=nf90_inq_dimid(nid,'time',rid) 83 82 print*,'nid,rid',nid,rid 84 83 nt_amma=0 85 IF (ierr.NE. NF_NOERR) THEN84 IF (ierr.NE.nf90_noerr) THEN 86 85 stop 'probleme lecture dimension sens' 87 86 ENDIF 88 ierr= NF_INQ_DIMLEN(nid,rid,nt_amma)87 ierr=nf90_inquire_dimension(nid,rid,len=nt_amma) 89 88 print*,'nid,rid,nlev_amma',nid,rid,nt_amma 90 89 … … 179 178 180 179 !program reading forcings of the AMMA case study 181 USE netcdf, ONLY: nf90_get_var 180 USE netcdf, ONLY: nf90_get_var, nf90_open, nf90_noerr, nf90_open, nf90_nowrite, & 181 nf90_inq_dimid, nf90_inquire_dimension, nf90_strerror, nf90_inq_varid 182 182 implicit none 183 INCLUDE "netcdf.inc"184 183 185 184 integer ntime,nlevel … … 200 199 integer var3didin(nbvar3d) 201 200 202 ierr= NF_INQ_VARID(nid,"zz",var3didin(1))203 if(ierr/= NF_NOERR) then204 write(*,*) NF_STRERROR(ierr)201 ierr=nf90_inq_varid(nid,"zz",var3didin(1)) 202 if(ierr/=nf90_noerr) then 203 write(*,*) nf90_strerror(ierr) 205 204 stop 'lev' 206 205 endif 207 206 208 207 209 ierr= NF_INQ_VARID(nid,"temp",var3didin(2))210 if(ierr/= NF_NOERR) then211 write(*,*) NF_STRERROR(ierr)208 ierr=nf90_inq_varid(nid,"temp",var3didin(2)) 209 if(ierr/=nf90_noerr) then 210 write(*,*) nf90_strerror(ierr) 212 211 stop 'temp' 213 212 endif 214 213 215 ierr= NF_INQ_VARID(nid,"qv",var3didin(3))216 if(ierr/= NF_NOERR) then217 write(*,*) NF_STRERROR(ierr)214 ierr=nf90_inq_varid(nid,"qv",var3didin(3)) 215 if(ierr/=nf90_noerr) then 216 write(*,*) nf90_strerror(ierr) 218 217 stop 'qv' 219 218 endif 220 219 221 ierr= NF_INQ_VARID(nid,"u",var3didin(4))222 if(ierr/= NF_NOERR) then223 write(*,*) NF_STRERROR(ierr)220 ierr=nf90_inq_varid(nid,"u",var3didin(4)) 221 if(ierr/=nf90_noerr) then 222 write(*,*) nf90_strerror(ierr) 224 223 stop 'u' 225 224 endif 226 225 227 ierr= NF_INQ_VARID(nid,"v",var3didin(5))228 if(ierr/= NF_NOERR) then229 write(*,*) NF_STRERROR(ierr)226 ierr=nf90_inq_varid(nid,"v",var3didin(5)) 227 if(ierr/=nf90_noerr) then 228 write(*,*) nf90_strerror(ierr) 230 229 stop 'v' 231 230 endif 232 231 233 ierr= NF_INQ_VARID(nid,"dw",var3didin(6))234 if(ierr/= NF_NOERR) then235 write(*,*) NF_STRERROR(ierr)232 ierr=nf90_inq_varid(nid,"dw",var3didin(6)) 233 if(ierr/=nf90_noerr) then 234 write(*,*) nf90_strerror(ierr) 236 235 stop 'dw' 237 236 endif 238 237 239 ierr= NF_INQ_VARID(nid,"dt",var3didin(7))240 if(ierr/= NF_NOERR) then241 write(*,*) NF_STRERROR(ierr)238 ierr=nf90_inq_varid(nid,"dt",var3didin(7)) 239 if(ierr/=nf90_noerr) then 240 write(*,*) nf90_strerror(ierr) 242 241 stop 'dt' 243 242 endif 244 243 245 ierr= NF_INQ_VARID(nid,"dq",var3didin(8))246 if(ierr/= NF_NOERR) then247 write(*,*) NF_STRERROR(ierr)244 ierr=nf90_inq_varid(nid,"dq",var3didin(8)) 245 if(ierr/=nf90_noerr) then 246 write(*,*) nf90_strerror(ierr) 248 247 stop 'dq' 249 248 endif 250 249 251 ierr= NF_INQ_VARID(nid,"sens",var3didin(9))252 if(ierr/= NF_NOERR) then253 write(*,*) NF_STRERROR(ierr)250 ierr=nf90_inq_varid(nid,"sens",var3didin(9)) 251 if(ierr/=nf90_noerr) then 252 write(*,*) nf90_strerror(ierr) 254 253 stop 'sens' 255 254 endif 256 255 257 ierr= NF_INQ_VARID(nid,"flat",var3didin(10))258 if(ierr/= NF_NOERR) then259 write(*,*) NF_STRERROR(ierr)256 ierr=nf90_inq_varid(nid,"flat",var3didin(10)) 257 if(ierr/=nf90_noerr) then 258 write(*,*) nf90_strerror(ierr) 260 259 stop 'flat' 261 260 endif 262 261 263 ierr= NF_INQ_VARID(nid,"pp",var3didin(11))264 if(ierr/= NF_NOERR) then265 write(*,*) NF_STRERROR(ierr)262 ierr=nf90_inq_varid(nid,"pp",var3didin(11)) 263 if(ierr/=nf90_noerr) then 264 write(*,*) nf90_strerror(ierr) 266 265 endif 267 266 … … 270 269 271 270 ierr = nf90_get_var(nid, var3didin(1), zz) 272 if(ierr/= NF_NOERR) then273 write(*,*) NF_STRERROR(ierr)271 if(ierr/=nf90_noerr) then 272 write(*,*) nf90_strerror(ierr) 274 273 stop "getvarup" 275 274 endif … … 277 276 278 277 ierr = nf90_get_var(nid, var3didin(2), temp) 279 if(ierr/= NF_NOERR) then280 write(*,*) NF_STRERROR(ierr)278 if(ierr/=nf90_noerr) then 279 write(*,*) nf90_strerror(ierr) 281 280 stop "getvarup" 282 281 endif … … 284 283 285 284 ierr = nf90_get_var(nid, var3didin(3), qv) 286 if(ierr/= NF_NOERR) then287 write(*,*) NF_STRERROR(ierr)285 if(ierr/=nf90_noerr) then 286 write(*,*) nf90_strerror(ierr) 288 287 stop "getvarup" 289 288 endif … … 291 290 292 291 ierr = nf90_get_var(nid, var3didin(4), u) 293 if(ierr/= NF_NOERR) then294 write(*,*) NF_STRERROR(ierr)292 if(ierr/=nf90_noerr) then 293 write(*,*) nf90_strerror(ierr) 295 294 stop "getvarup" 296 295 endif … … 298 297 299 298 ierr = nf90_get_var(nid, var3didin(5), v) 300 if(ierr/= NF_NOERR) then301 write(*,*) NF_STRERROR(ierr)299 if(ierr/=nf90_noerr) then 300 write(*,*) nf90_strerror(ierr) 302 301 stop "getvarup" 303 302 endif … … 305 304 306 305 ierr = nf90_get_var(nid, var3didin(6), dw) 307 if(ierr/= NF_NOERR) then308 write(*,*) NF_STRERROR(ierr)306 if(ierr/=nf90_noerr) then 307 write(*,*) nf90_strerror(ierr) 309 308 stop "getvarup" 310 309 endif … … 312 311 313 312 ierr = nf90_get_var(nid, var3didin(7), dt) 314 if(ierr/= NF_NOERR) then315 write(*,*) NF_STRERROR(ierr)313 if(ierr/=nf90_noerr) then 314 write(*,*) nf90_strerror(ierr) 316 315 stop "getvarup" 317 316 endif … … 319 318 320 319 ierr = nf90_get_var(nid, var3didin(8), dq) 321 if(ierr/= NF_NOERR) then322 write(*,*) NF_STRERROR(ierr)320 if(ierr/=nf90_noerr) then 321 write(*,*) nf90_strerror(ierr) 323 322 stop "getvarup" 324 323 endif … … 326 325 327 326 ierr = nf90_get_var(nid, var3didin(9), sens) 328 if(ierr/= NF_NOERR) then329 write(*,*) NF_STRERROR(ierr)327 if(ierr/=nf90_noerr) then 328 write(*,*) nf90_strerror(ierr) 330 329 stop "getvarup" 331 330 endif … … 333 332 334 333 ierr = nf90_get_var(nid, var3didin(10), flat) 335 if(ierr/= NF_NOERR) then336 write(*,*) NF_STRERROR(ierr)334 if(ierr/=nf90_noerr) then 335 write(*,*) nf90_strerror(ierr) 337 336 stop "getvarup" 338 337 endif … … 340 339 341 340 ierr = nf90_get_var(nid, var3didin(11), pp) 342 if(ierr/= NF_NOERR) then343 write(*,*) NF_STRERROR(ierr)341 if(ierr/=nf90_noerr) then 342 write(*,*) nf90_strerror(ierr) 344 343 stop "getvarup" 345 344 endif -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read.f90
r5268 r5270 3 3 ! 4 4 MODULE mod_1D_cases_read 5 USE netcdf, ONLY: nf90_get_var, nf90_strerror, nf90_inq_varid, nf90_inquire_dimension, nf90_noerr, & 6 nf90_inq_dimid, nf90_nowrite, nf90_open 7 5 8 6 9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 90 93 implicit none 91 94 92 INCLUDE "netcdf.inc"93 94 95 INTEGER nid,rid,ierr 95 96 INTEGER ii,jj … … 97 98 fich_cas='setup/cas.nc' 98 99 print*,'fich_cas ',fich_cas 99 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)100 print*,'fich_cas, NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid101 if (ierr.NE. NF_NOERR) then100 ierr = nf90_open(fich_cas,nf90_nowrite,nid) 101 print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid 102 if (ierr.NE.nf90_noerr) then 102 103 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 103 write(*,*) NF_STRERROR(ierr)104 write(*,*) nf90_strerror(ierr) 104 105 stop "" 105 106 endif 106 107 !....................................................................... 107 ierr= NF_INQ_DIMID(nid,'lat',rid)108 IF (ierr.NE. NF_NOERR) THEN108 ierr=nf90_inq_dimid(nid,'lat',rid) 109 IF (ierr.NE.nf90_noerr) THEN 109 110 print*, 'Oh probleme lecture dimension lat' 110 111 ENDIF 111 ierr= NF_INQ_DIMLEN(nid,rid,ii)112 ierr=nf90_inquire_dimension(nid,rid,len=ii) 112 113 print*,'OK1 nid,rid,lat',nid,rid,ii 113 114 !....................................................................... 114 ierr= NF_INQ_DIMID(nid,'lon',rid)115 IF (ierr.NE. NF_NOERR) THEN115 ierr=nf90_inq_dimid(nid,'lon',rid) 116 IF (ierr.NE.nf90_noerr) THEN 116 117 print*, 'Oh probleme lecture dimension lon' 117 118 ENDIF 118 ierr= NF_INQ_DIMLEN(nid,rid,jj)119 ierr=nf90_inquire_dimension(nid,rid,len=jj) 119 120 print*,'OK2 nid,rid,lat',nid,rid,jj 120 121 !....................................................................... 121 ierr= NF_INQ_DIMID(nid,'lev',rid)122 IF (ierr.NE. NF_NOERR) THEN122 ierr=nf90_inq_dimid(nid,'lev',rid) 123 IF (ierr.NE.nf90_noerr) THEN 123 124 print*, 'Oh probleme lecture dimension zz' 124 125 ENDIF 125 ierr= NF_INQ_DIMLEN(nid,rid,nlev_cas)126 ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas) 126 127 print*,'OK3 nid,rid,nlev_cas',nid,rid,nlev_cas 127 128 !....................................................................... 128 ierr= NF_INQ_DIMID(nid,'time',rid)129 ierr=nf90_inq_dimid(nid,'time',rid) 129 130 print*,'nid,rid',nid,rid 130 131 nt_cas=0 131 IF (ierr.NE. NF_NOERR) THEN132 IF (ierr.NE.nf90_noerr) THEN 132 133 stop 'probleme lecture dimension sens' 133 134 ENDIF 134 ierr= NF_INQ_DIMLEN(nid,rid,nt_cas)135 ierr=nf90_inquire_dimension(nid,rid,len=nt_cas) 135 136 print*,'OK4 nid,rid,nt_cas',nid,rid,nt_cas 136 137 … … 264 265 & du,hu,vu,dv,hv,vv,dt,dtrad,ht,vt,dq,hq,vq, & 265 266 & dth,hth,vth,dr,hr,vr,sens,flat,ts,ustar,uw,vw,q1,q2) 267 USE netcdf, ONLY: nf90_get_var, nf90_strerror, nf90_inq_varid, nf90_inquire_dimension, nf90_noerr, & 268 nf90_inq_dimid, nf90_nowrite 266 269 267 270 !program reading forcing of the case study 268 USE netcdf, ONLY: nf90_get_var269 271 implicit none 270 INCLUDE "netcdf.inc"271 272 272 273 integer ntime,nlevel … … 297 298 integer var3didin(nbvar3d) 298 299 299 ierr= NF_INQ_VARID(nid,"zz",var3didin(1))300 if(ierr/= NF_NOERR) then301 write(*,*) NF_STRERROR(ierr)300 ierr=nf90_inq_varid(nid,"zz",var3didin(1)) 301 if(ierr/=nf90_noerr) then 302 write(*,*) nf90_strerror(ierr) 302 303 stop 'lev' 303 304 endif 304 305 305 ierr= NF_INQ_VARID(nid,"pp",var3didin(2))306 if(ierr/= NF_NOERR) then307 write(*,*) NF_STRERROR(ierr)306 ierr=nf90_inq_varid(nid,"pp",var3didin(2)) 307 if(ierr/=nf90_noerr) then 308 write(*,*) nf90_strerror(ierr) 308 309 stop 'plev' 309 310 endif 310 311 311 312 312 ierr= NF_INQ_VARID(nid,"temp",var3didin(3))313 if(ierr/= NF_NOERR) then314 write(*,*) NF_STRERROR(ierr)313 ierr=nf90_inq_varid(nid,"temp",var3didin(3)) 314 if(ierr/=nf90_noerr) then 315 write(*,*) nf90_strerror(ierr) 315 316 stop 'temp' 316 317 endif 317 318 318 ierr= NF_INQ_VARID(nid,"qv",var3didin(4))319 if(ierr/= NF_NOERR) then320 write(*,*) NF_STRERROR(ierr)319 ierr=nf90_inq_varid(nid,"qv",var3didin(4)) 320 if(ierr/=nf90_noerr) then 321 write(*,*) nf90_strerror(ierr) 321 322 stop 'qv' 322 323 endif 323 324 324 ierr= NF_INQ_VARID(nid,"rh",var3didin(5))325 if(ierr/= NF_NOERR) then326 write(*,*) NF_STRERROR(ierr)325 ierr=nf90_inq_varid(nid,"rh",var3didin(5)) 326 if(ierr/=nf90_noerr) then 327 write(*,*) nf90_strerror(ierr) 327 328 stop 'rh' 328 329 endif 329 330 330 ierr= NF_INQ_VARID(nid,"theta",var3didin(6))331 if(ierr/= NF_NOERR) then332 write(*,*) NF_STRERROR(ierr)331 ierr=nf90_inq_varid(nid,"theta",var3didin(6)) 332 if(ierr/=nf90_noerr) then 333 write(*,*) nf90_strerror(ierr) 333 334 stop 'theta' 334 335 endif 335 336 336 ierr= NF_INQ_VARID(nid,"rv",var3didin(7))337 if(ierr/= NF_NOERR) then338 write(*,*) NF_STRERROR(ierr)337 ierr=nf90_inq_varid(nid,"rv",var3didin(7)) 338 if(ierr/=nf90_noerr) then 339 write(*,*) nf90_strerror(ierr) 339 340 stop 'rv' 340 341 endif 341 342 342 343 343 ierr= NF_INQ_VARID(nid,"u",var3didin(8))344 if(ierr/= NF_NOERR) then345 write(*,*) NF_STRERROR(ierr)344 ierr=nf90_inq_varid(nid,"u",var3didin(8)) 345 if(ierr/=nf90_noerr) then 346 write(*,*) nf90_strerror(ierr) 346 347 stop 'u' 347 348 endif 348 349 349 ierr= NF_INQ_VARID(nid,"v",var3didin(9))350 if(ierr/= NF_NOERR) then351 write(*,*) NF_STRERROR(ierr)350 ierr=nf90_inq_varid(nid,"v",var3didin(9)) 351 if(ierr/=nf90_noerr) then 352 write(*,*) nf90_strerror(ierr) 352 353 stop 'v' 353 354 endif 354 355 355 ierr= NF_INQ_VARID(nid,"ug",var3didin(10))356 if(ierr/= NF_NOERR) then357 write(*,*) NF_STRERROR(ierr)356 ierr=nf90_inq_varid(nid,"ug",var3didin(10)) 357 if(ierr/=nf90_noerr) then 358 write(*,*) nf90_strerror(ierr) 358 359 stop 'ug' 359 360 endif 360 361 361 ierr= NF_INQ_VARID(nid,"vg",var3didin(11))362 if(ierr/= NF_NOERR) then363 write(*,*) NF_STRERROR(ierr)362 ierr=nf90_inq_varid(nid,"vg",var3didin(11)) 363 if(ierr/=nf90_noerr) then 364 write(*,*) nf90_strerror(ierr) 364 365 stop 'vg' 365 366 endif 366 367 367 ierr= NF_INQ_VARID(nid,"w",var3didin(12))368 if(ierr/= NF_NOERR) then369 write(*,*) NF_STRERROR(ierr)368 ierr=nf90_inq_varid(nid,"w",var3didin(12)) 369 if(ierr/=nf90_noerr) then 370 write(*,*) nf90_strerror(ierr) 370 371 stop 'w' 371 372 endif 372 373 373 ierr= NF_INQ_VARID(nid,"advu",var3didin(13))374 if(ierr/= NF_NOERR) then375 write(*,*) NF_STRERROR(ierr)374 ierr=nf90_inq_varid(nid,"advu",var3didin(13)) 375 if(ierr/=nf90_noerr) then 376 write(*,*) nf90_strerror(ierr) 376 377 stop 'advu' 377 378 endif 378 379 379 ierr= NF_INQ_VARID(nid,"hu",var3didin(14))380 if(ierr/= NF_NOERR) then381 write(*,*) NF_STRERROR(ierr)380 ierr=nf90_inq_varid(nid,"hu",var3didin(14)) 381 if(ierr/=nf90_noerr) then 382 write(*,*) nf90_strerror(ierr) 382 383 stop 'hu' 383 384 endif 384 385 385 ierr= NF_INQ_VARID(nid,"vu",var3didin(15))386 if(ierr/= NF_NOERR) then387 write(*,*) NF_STRERROR(ierr)386 ierr=nf90_inq_varid(nid,"vu",var3didin(15)) 387 if(ierr/=nf90_noerr) then 388 write(*,*) nf90_strerror(ierr) 388 389 stop 'vu' 389 390 endif 390 391 391 ierr= NF_INQ_VARID(nid,"advv",var3didin(16))392 if(ierr/= NF_NOERR) then393 write(*,*) NF_STRERROR(ierr)392 ierr=nf90_inq_varid(nid,"advv",var3didin(16)) 393 if(ierr/=nf90_noerr) then 394 write(*,*) nf90_strerror(ierr) 394 395 stop 'advv' 395 396 endif 396 397 397 ierr= NF_INQ_VARID(nid,"hv",var3didin(17))398 if(ierr/= NF_NOERR) then399 write(*,*) NF_STRERROR(ierr)398 ierr=nf90_inq_varid(nid,"hv",var3didin(17)) 399 if(ierr/=nf90_noerr) then 400 write(*,*) nf90_strerror(ierr) 400 401 stop 'hv' 401 402 endif 402 403 403 ierr= NF_INQ_VARID(nid,"vv",var3didin(18))404 if(ierr/= NF_NOERR) then405 write(*,*) NF_STRERROR(ierr)404 ierr=nf90_inq_varid(nid,"vv",var3didin(18)) 405 if(ierr/=nf90_noerr) then 406 write(*,*) nf90_strerror(ierr) 406 407 stop 'vv' 407 408 endif 408 409 409 ierr= NF_INQ_VARID(nid,"advT",var3didin(19))410 if(ierr/= NF_NOERR) then411 write(*,*) NF_STRERROR(ierr)410 ierr=nf90_inq_varid(nid,"advT",var3didin(19)) 411 if(ierr/=nf90_noerr) then 412 write(*,*) nf90_strerror(ierr) 412 413 stop 'advT' 413 414 endif 414 415 415 ierr= NF_INQ_VARID(nid,"hT",var3didin(20))416 if(ierr/= NF_NOERR) then417 write(*,*) NF_STRERROR(ierr)416 ierr=nf90_inq_varid(nid,"hT",var3didin(20)) 417 if(ierr/=nf90_noerr) then 418 write(*,*) nf90_strerror(ierr) 418 419 stop 'hT' 419 420 endif 420 421 421 ierr= NF_INQ_VARID(nid,"vT",var3didin(21))422 if(ierr/= NF_NOERR) then423 write(*,*) NF_STRERROR(ierr)422 ierr=nf90_inq_varid(nid,"vT",var3didin(21)) 423 if(ierr/=nf90_noerr) then 424 write(*,*) nf90_strerror(ierr) 424 425 stop 'vT' 425 426 endif 426 427 427 ierr= NF_INQ_VARID(nid,"advq",var3didin(22))428 if(ierr/= NF_NOERR) then429 write(*,*) NF_STRERROR(ierr)428 ierr=nf90_inq_varid(nid,"advq",var3didin(22)) 429 if(ierr/=nf90_noerr) then 430 write(*,*) nf90_strerror(ierr) 430 431 stop 'advq' 431 432 endif 432 433 433 ierr= NF_INQ_VARID(nid,"hq",var3didin(23))434 if(ierr/= NF_NOERR) then435 write(*,*) NF_STRERROR(ierr)434 ierr=nf90_inq_varid(nid,"hq",var3didin(23)) 435 if(ierr/=nf90_noerr) then 436 write(*,*) nf90_strerror(ierr) 436 437 stop 'hq' 437 438 endif 438 439 439 ierr= NF_INQ_VARID(nid,"vq",var3didin(24))440 if(ierr/= NF_NOERR) then441 write(*,*) NF_STRERROR(ierr)440 ierr=nf90_inq_varid(nid,"vq",var3didin(24)) 441 if(ierr/=nf90_noerr) then 442 write(*,*) nf90_strerror(ierr) 442 443 stop 'vq' 443 444 endif 444 445 445 ierr= NF_INQ_VARID(nid,"advth",var3didin(25))446 if(ierr/= NF_NOERR) then447 write(*,*) NF_STRERROR(ierr)446 ierr=nf90_inq_varid(nid,"advth",var3didin(25)) 447 if(ierr/=nf90_noerr) then 448 write(*,*) nf90_strerror(ierr) 448 449 stop 'advth' 449 450 endif 450 451 451 ierr= NF_INQ_VARID(nid,"hth",var3didin(26))452 if(ierr/= NF_NOERR) then453 write(*,*) NF_STRERROR(ierr)452 ierr=nf90_inq_varid(nid,"hth",var3didin(26)) 453 if(ierr/=nf90_noerr) then 454 write(*,*) nf90_strerror(ierr) 454 455 stop 'hth' 455 456 endif 456 457 457 ierr= NF_INQ_VARID(nid,"vth",var3didin(27))458 if(ierr/= NF_NOERR) then459 write(*,*) NF_STRERROR(ierr)458 ierr=nf90_inq_varid(nid,"vth",var3didin(27)) 459 if(ierr/=nf90_noerr) then 460 write(*,*) nf90_strerror(ierr) 460 461 stop 'vth' 461 462 endif 462 463 463 ierr= NF_INQ_VARID(nid,"advr",var3didin(28))464 if(ierr/= NF_NOERR) then465 write(*,*) NF_STRERROR(ierr)464 ierr=nf90_inq_varid(nid,"advr",var3didin(28)) 465 if(ierr/=nf90_noerr) then 466 write(*,*) nf90_strerror(ierr) 466 467 stop 'advr' 467 468 endif 468 469 469 ierr= NF_INQ_VARID(nid,"hr",var3didin(29))470 if(ierr/= NF_NOERR) then471 write(*,*) NF_STRERROR(ierr)470 ierr=nf90_inq_varid(nid,"hr",var3didin(29)) 471 if(ierr/=nf90_noerr) then 472 write(*,*) nf90_strerror(ierr) 472 473 stop 'hr' 473 474 endif 474 475 475 ierr= NF_INQ_VARID(nid,"vr",var3didin(30))476 if(ierr/= NF_NOERR) then477 write(*,*) NF_STRERROR(ierr)476 ierr=nf90_inq_varid(nid,"vr",var3didin(30)) 477 if(ierr/=nf90_noerr) then 478 write(*,*) nf90_strerror(ierr) 478 479 stop 'vr' 479 480 endif 480 481 481 ierr= NF_INQ_VARID(nid,"radT",var3didin(31))482 if(ierr/= NF_NOERR) then483 write(*,*) NF_STRERROR(ierr)482 ierr=nf90_inq_varid(nid,"radT",var3didin(31)) 483 if(ierr/=nf90_noerr) then 484 write(*,*) nf90_strerror(ierr) 484 485 stop 'radT' 485 486 endif 486 487 487 ierr= NF_INQ_VARID(nid,"sens",var3didin(32))488 if(ierr/= NF_NOERR) then489 write(*,*) NF_STRERROR(ierr)488 ierr=nf90_inq_varid(nid,"sens",var3didin(32)) 489 if(ierr/=nf90_noerr) then 490 write(*,*) nf90_strerror(ierr) 490 491 stop 'sens' 491 492 endif 492 493 493 ierr= NF_INQ_VARID(nid,"flat",var3didin(33))494 if(ierr/= NF_NOERR) then495 write(*,*) NF_STRERROR(ierr)494 ierr=nf90_inq_varid(nid,"flat",var3didin(33)) 495 if(ierr/=nf90_noerr) then 496 write(*,*) nf90_strerror(ierr) 496 497 stop 'flat' 497 498 endif 498 499 499 ierr= NF_INQ_VARID(nid,"ts",var3didin(34))500 if(ierr/= NF_NOERR) then501 write(*,*) NF_STRERROR(ierr)500 ierr=nf90_inq_varid(nid,"ts",var3didin(34)) 501 if(ierr/=nf90_noerr) then 502 write(*,*) nf90_strerror(ierr) 502 503 stop 'ts' 503 504 endif 504 505 505 ierr= NF_INQ_VARID(nid,"ustar",var3didin(35))506 if(ierr/= NF_NOERR) then507 write(*,*) NF_STRERROR(ierr)506 ierr=nf90_inq_varid(nid,"ustar",var3didin(35)) 507 if(ierr/=nf90_noerr) then 508 write(*,*) nf90_strerror(ierr) 508 509 stop 'ustar' 509 510 endif 510 511 511 ierr= NF_INQ_VARID(nid,"uw",var3didin(36))512 if(ierr/= NF_NOERR) then513 write(*,*) NF_STRERROR(ierr)512 ierr=nf90_inq_varid(nid,"uw",var3didin(36)) 513 if(ierr/=nf90_noerr) then 514 write(*,*) nf90_strerror(ierr) 514 515 stop 'uw' 515 516 endif 516 517 517 ierr= NF_INQ_VARID(nid,"vw",var3didin(37))518 if(ierr/= NF_NOERR) then519 write(*,*) NF_STRERROR(ierr)518 ierr=nf90_inq_varid(nid,"vw",var3didin(37)) 519 if(ierr/=nf90_noerr) then 520 write(*,*) nf90_strerror(ierr) 520 521 stop 'vw' 521 522 endif 522 523 523 ierr= NF_INQ_VARID(nid,"q1",var3didin(38))524 if(ierr/= NF_NOERR) then525 write(*,*) NF_STRERROR(ierr)524 ierr=nf90_inq_varid(nid,"q1",var3didin(38)) 525 if(ierr/=nf90_noerr) then 526 write(*,*) nf90_strerror(ierr) 526 527 stop 'q1' 527 528 endif 528 529 529 ierr= NF_INQ_VARID(nid,"q2",var3didin(39))530 if(ierr/= NF_NOERR) then531 write(*,*) NF_STRERROR(ierr)530 ierr=nf90_inq_varid(nid,"q2",var3didin(39)) 531 if(ierr/=nf90_noerr) then 532 write(*,*) nf90_strerror(ierr) 532 533 stop 'q2' 533 534 endif 534 535 535 536 ierr = nf90_get_var(nid, var3didin(1), zz) 536 if(ierr/= NF_NOERR) then537 write(*,*) NF_STRERROR(ierr)537 if(ierr/=nf90_noerr) then 538 write(*,*) nf90_strerror(ierr) 538 539 stop "getvarup" 539 540 endif … … 541 542 542 543 ierr = nf90_get_var(nid, var3didin(2), pp) 543 if(ierr/= NF_NOERR) then544 write(*,*) NF_STRERROR(ierr)544 if(ierr/=nf90_noerr) then 545 write(*,*) nf90_strerror(ierr) 545 546 stop "getvarup" 546 547 endif … … 549 550 550 551 ierr = nf90_get_var(nid, var3didin(3), temp) 551 if(ierr/= NF_NOERR) then552 write(*,*) NF_STRERROR(ierr)552 if(ierr/=nf90_noerr) then 553 write(*,*) nf90_strerror(ierr) 553 554 stop "getvarup" 554 555 endif … … 556 557 557 558 ierr = nf90_get_var(nid, var3didin(4), qv) 558 if(ierr/= NF_NOERR) then559 write(*,*) NF_STRERROR(ierr)559 if(ierr/=nf90_noerr) then 560 write(*,*) nf90_strerror(ierr) 560 561 stop "getvarup" 561 562 endif … … 563 564 564 565 ierr = nf90_get_var(nid, var3didin(5), rh) 565 if(ierr/= NF_NOERR) then566 write(*,*) NF_STRERROR(ierr)566 if(ierr/=nf90_noerr) then 567 write(*,*) nf90_strerror(ierr) 567 568 stop "getvarup" 568 569 endif … … 570 571 571 572 ierr = nf90_get_var(nid, var3didin(6), theta) 572 if(ierr/= NF_NOERR) then573 write(*,*) NF_STRERROR(ierr)573 if(ierr/=nf90_noerr) then 574 write(*,*) nf90_strerror(ierr) 574 575 stop "getvarup" 575 576 endif … … 577 578 578 579 ierr = nf90_get_var(nid, var3didin(7), rv) 579 if(ierr/= NF_NOERR) then580 write(*,*) NF_STRERROR(ierr)580 if(ierr/=nf90_noerr) then 581 write(*,*) nf90_strerror(ierr) 581 582 stop "getvarup" 582 583 endif … … 584 585 585 586 ierr = nf90_get_var(nid, var3didin(8), u) 586 if(ierr/= NF_NOERR) then587 write(*,*) NF_STRERROR(ierr)587 if(ierr/=nf90_noerr) then 588 write(*,*) nf90_strerror(ierr) 588 589 stop "getvarup" 589 590 endif … … 591 592 592 593 ierr = nf90_get_var(nid, var3didin(9), v) 593 if(ierr/= NF_NOERR) then594 write(*,*) NF_STRERROR(ierr)594 if(ierr/=nf90_noerr) then 595 write(*,*) nf90_strerror(ierr) 595 596 stop "getvarup" 596 597 endif … … 598 599 599 600 ierr = nf90_get_var(nid, var3didin(10), ug) 600 if(ierr/= NF_NOERR) then601 write(*,*) NF_STRERROR(ierr)601 if(ierr/=nf90_noerr) then 602 write(*,*) nf90_strerror(ierr) 602 603 stop "getvarup" 603 604 endif … … 605 606 606 607 ierr = nf90_get_var(nid, var3didin(11), vg) 607 if(ierr/= NF_NOERR) then608 write(*,*) NF_STRERROR(ierr)608 if(ierr/=nf90_noerr) then 609 write(*,*) nf90_strerror(ierr) 609 610 stop "getvarup" 610 611 endif … … 612 613 613 614 ierr = nf90_get_var(nid, var3didin(12), w) 614 if(ierr/= NF_NOERR) then615 write(*,*) NF_STRERROR(ierr)615 if(ierr/=nf90_noerr) then 616 write(*,*) nf90_strerror(ierr) 616 617 stop "getvarup" 617 618 endif … … 619 620 620 621 ierr = nf90_get_var(nid, var3didin(13), du) 621 if(ierr/= NF_NOERR) then622 write(*,*) NF_STRERROR(ierr)622 if(ierr/=nf90_noerr) then 623 write(*,*) nf90_strerror(ierr) 623 624 stop "getvarup" 624 625 endif … … 626 627 627 628 ierr = nf90_get_var(nid, var3didin(14), hu) 628 if(ierr/= NF_NOERR) then629 write(*,*) NF_STRERROR(ierr)629 if(ierr/=nf90_noerr) then 630 write(*,*) nf90_strerror(ierr) 630 631 stop "getvarup" 631 632 endif … … 633 634 634 635 ierr = nf90_get_var(nid, var3didin(15), vu) 635 if(ierr/= NF_NOERR) then636 write(*,*) NF_STRERROR(ierr)636 if(ierr/=nf90_noerr) then 637 write(*,*) nf90_strerror(ierr) 637 638 stop "getvarup" 638 639 endif … … 640 641 641 642 ierr = nf90_get_var(nid, var3didin(16), dv) 642 if(ierr/= NF_NOERR) then643 write(*,*) NF_STRERROR(ierr)643 if(ierr/=nf90_noerr) then 644 write(*,*) nf90_strerror(ierr) 644 645 stop "getvarup" 645 646 endif … … 647 648 648 649 ierr = nf90_get_var(nid, var3didin(17), hv) 649 if(ierr/= NF_NOERR) then650 write(*,*) NF_STRERROR(ierr)650 if(ierr/=nf90_noerr) then 651 write(*,*) nf90_strerror(ierr) 651 652 stop "getvarup" 652 653 endif … … 654 655 655 656 ierr = nf90_get_var(nid, var3didin(18), vv) 656 if(ierr/= NF_NOERR) then657 write(*,*) NF_STRERROR(ierr)657 if(ierr/=nf90_noerr) then 658 write(*,*) nf90_strerror(ierr) 658 659 stop "getvarup" 659 660 endif … … 661 662 662 663 ierr = nf90_get_var(nid, var3didin(19), dt) 663 if(ierr/= NF_NOERR) then664 write(*,*) NF_STRERROR(ierr)664 if(ierr/=nf90_noerr) then 665 write(*,*) nf90_strerror(ierr) 665 666 stop "getvarup" 666 667 endif … … 668 669 669 670 ierr = nf90_get_var(nid, var3didin(20), ht) 670 if(ierr/= NF_NOERR) then671 write(*,*) NF_STRERROR(ierr)671 if(ierr/=nf90_noerr) then 672 write(*,*) nf90_strerror(ierr) 672 673 stop "getvarup" 673 674 endif … … 675 676 676 677 ierr = nf90_get_var(nid, var3didin(21), vt) 677 if(ierr/= NF_NOERR) then678 write(*,*) NF_STRERROR(ierr)678 if(ierr/=nf90_noerr) then 679 write(*,*) nf90_strerror(ierr) 679 680 stop "getvarup" 680 681 endif … … 682 683 683 684 ierr = nf90_get_var(nid, var3didin(22), dq) 684 if(ierr/= NF_NOERR) then685 write(*,*) NF_STRERROR(ierr)685 if(ierr/=nf90_noerr) then 686 write(*,*) nf90_strerror(ierr) 686 687 stop "getvarup" 687 688 endif … … 689 690 690 691 ierr = nf90_get_var(nid, var3didin(23), hq) 691 if(ierr/= NF_NOERR) then692 write(*,*) NF_STRERROR(ierr)692 if(ierr/=nf90_noerr) then 693 write(*,*) nf90_strerror(ierr) 693 694 stop "getvarup" 694 695 endif … … 696 697 697 698 ierr = nf90_get_var(nid, var3didin(24), vq) 698 if(ierr/= NF_NOERR) then699 write(*,*) NF_STRERROR(ierr)699 if(ierr/=nf90_noerr) then 700 write(*,*) nf90_strerror(ierr) 700 701 stop "getvarup" 701 702 endif … … 703 704 704 705 ierr = nf90_get_var(nid, var3didin(25), dth) 705 if(ierr/= NF_NOERR) then706 write(*,*) NF_STRERROR(ierr)706 if(ierr/=nf90_noerr) then 707 write(*,*) nf90_strerror(ierr) 707 708 stop "getvarup" 708 709 endif … … 710 711 711 712 ierr = nf90_get_var(nid, var3didin(26), hth) 712 if(ierr/= NF_NOERR) then713 write(*,*) NF_STRERROR(ierr)713 if(ierr/=nf90_noerr) then 714 write(*,*) nf90_strerror(ierr) 714 715 stop "getvarup" 715 716 endif … … 717 718 718 719 ierr = nf90_get_var(nid, var3didin(27), vth) 719 if(ierr/= NF_NOERR) then720 write(*,*) NF_STRERROR(ierr)720 if(ierr/=nf90_noerr) then 721 write(*,*) nf90_strerror(ierr) 721 722 stop "getvarup" 722 723 endif … … 724 725 725 726 ierr = nf90_get_var(nid, var3didin(28), dr) 726 if(ierr/= NF_NOERR) then727 write(*,*) NF_STRERROR(ierr)727 if(ierr/=nf90_noerr) then 728 write(*,*) nf90_strerror(ierr) 728 729 stop "getvarup" 729 730 endif … … 731 732 732 733 ierr = nf90_get_var(nid, var3didin(29), hr) 733 if(ierr/= NF_NOERR) then734 write(*,*) NF_STRERROR(ierr)734 if(ierr/=nf90_noerr) then 735 write(*,*) nf90_strerror(ierr) 735 736 stop "getvarup" 736 737 endif … … 738 739 739 740 ierr = nf90_get_var(nid, var3didin(30), vr) 740 if(ierr/= NF_NOERR) then741 write(*,*) NF_STRERROR(ierr)741 if(ierr/=nf90_noerr) then 742 write(*,*) nf90_strerror(ierr) 742 743 stop "getvarup" 743 744 endif … … 745 746 746 747 ierr = nf90_get_var(nid, var3didin(31), dtrad) 747 if(ierr/= NF_NOERR) then748 write(*,*) NF_STRERROR(ierr)748 if(ierr/=nf90_noerr) then 749 write(*,*) nf90_strerror(ierr) 749 750 stop "getvarup" 750 751 endif … … 752 753 753 754 ierr = nf90_get_var(nid, var3didin(32), sens) 754 if(ierr/= NF_NOERR) then755 write(*,*) NF_STRERROR(ierr)755 if(ierr/=nf90_noerr) then 756 write(*,*) nf90_strerror(ierr) 756 757 stop "getvarup" 757 758 endif … … 759 760 760 761 ierr = nf90_get_var(nid, var3didin(33), flat) 761 if(ierr/= NF_NOERR) then762 write(*,*) NF_STRERROR(ierr)762 if(ierr/=nf90_noerr) then 763 write(*,*) nf90_strerror(ierr) 763 764 stop "getvarup" 764 765 endif … … 766 767 767 768 ierr = nf90_get_var(nid, var3didin(34), ts) 768 if(ierr/= NF_NOERR) then769 write(*,*) NF_STRERROR(ierr)769 if(ierr/=nf90_noerr) then 770 write(*,*) nf90_strerror(ierr) 770 771 stop "getvarup" 771 772 endif … … 773 774 774 775 ierr = nf90_get_var(nid, var3didin(35), ustar) 775 if(ierr/= NF_NOERR) then776 write(*,*) NF_STRERROR(ierr)776 if(ierr/=nf90_noerr) then 777 write(*,*) nf90_strerror(ierr) 777 778 stop "getvarup" 778 779 endif … … 780 781 781 782 ierr = nf90_get_var(nid, var3didin(36), uw) 782 if(ierr/= NF_NOERR) then783 write(*,*) NF_STRERROR(ierr)783 if(ierr/=nf90_noerr) then 784 write(*,*) nf90_strerror(ierr) 784 785 stop "getvarup" 785 786 endif … … 787 788 788 789 ierr = nf90_get_var(nid, var3didin(37), vw) 789 if(ierr/= NF_NOERR) then790 write(*,*) NF_STRERROR(ierr)790 if(ierr/=nf90_noerr) then 791 write(*,*) nf90_strerror(ierr) 791 792 stop "getvarup" 792 793 endif … … 794 795 795 796 ierr = nf90_get_var(nid, var3didin(38), q1) 796 if(ierr/= NF_NOERR) then797 write(*,*) NF_STRERROR(ierr)797 if(ierr/=nf90_noerr) then 798 write(*,*) nf90_strerror(ierr) 798 799 stop "getvarup" 799 800 endif … … 801 802 802 803 ierr = nf90_get_var(nid, var3didin(39), q2) 803 if(ierr/= NF_NOERR) then804 write(*,*) NF_STRERROR(ierr)804 if(ierr/=nf90_noerr) then 805 write(*,*) nf90_strerror(ierr) 805 806 stop "getvarup" 806 807 endif -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.f90
r5268 r5270 3 3 ! 4 4 MODULE mod_1D_cases_read2 5 5 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_inq_varid, nf90_inquire_dimension, nf90_strerror, nf90_open, & 6 nf90_nowrite, nf90_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 … … 88 87 fich_cas='setup/cas.nc' 89 88 print*,'fich_cas ',fich_cas 90 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)91 print*,'fich_cas, NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid92 if (ierr.NE. NF_NOERR) then89 ierr = nf90_open(fich_cas,nf90_nowrite,nid) 90 print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid 91 if (ierr.NE.nf90_noerr) then 93 92 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 94 write(*,*) NF_STRERROR(ierr)93 write(*,*) nf90_strerror(ierr) 95 94 stop "" 96 95 endif 97 96 !....................................................................... 98 ierr= NF_INQ_DIMID(nid,'lat',rid)99 IF (ierr.NE. NF_NOERR) THEN97 ierr=nf90_inq_dimid(nid,'lat',rid) 98 IF (ierr.NE.nf90_noerr) THEN 100 99 print*, 'Oh probleme lecture dimension lat' 101 100 ENDIF 102 ierr= NF_INQ_DIMLEN(nid,rid,ii)101 ierr=nf90_inquire_dimension(nid,rid,len=ii) 103 102 print*,'OK1 nid,rid,lat',nid,rid,ii 104 103 !....................................................................... 105 ierr= NF_INQ_DIMID(nid,'lon',rid)106 IF (ierr.NE. NF_NOERR) THEN104 ierr=nf90_inq_dimid(nid,'lon',rid) 105 IF (ierr.NE.nf90_noerr) THEN 107 106 print*, 'Oh probleme lecture dimension lon' 108 107 ENDIF 109 ierr= NF_INQ_DIMLEN(nid,rid,jj)108 ierr=nf90_inquire_dimension(nid,rid,len=jj) 110 109 print*,'OK2 nid,rid,lat',nid,rid,jj 111 110 !....................................................................... 112 ierr= NF_INQ_DIMID(nid,'lev',rid)113 IF (ierr.NE. NF_NOERR) THEN111 ierr=nf90_inq_dimid(nid,'lev',rid) 112 IF (ierr.NE.nf90_noerr) THEN 114 113 print*, 'Oh probleme lecture dimension zz' 115 114 ENDIF 116 ierr= NF_INQ_DIMLEN(nid,rid,nlev_cas)115 ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas) 117 116 print*,'OK3 nid,rid,nlev_cas',nid,rid,nlev_cas 118 117 !....................................................................... 119 ierr= NF_INQ_DIMID(nid,'time',rid)118 ierr=nf90_inq_dimid(nid,'time',rid) 120 119 print*,'nid,rid',nid,rid 121 120 nt_cas=0 122 IF (ierr.NE. NF_NOERR) THEN121 IF (ierr.NE.nf90_noerr) THEN 123 122 stop 'probleme lecture dimension sens' 124 123 ENDIF 125 ierr= NF_INQ_DIMLEN(nid,rid,nt_cas)124 ierr=nf90_inquire_dimension(nid,rid,len=nt_cas) 126 125 print*,'OK4 nid,rid,nt_cas',nid,rid,nt_cas 127 126 … … 192 191 implicit none 193 192 194 INCLUDE "netcdf.inc"195 196 193 INTEGER nid,rid,ierr 197 194 INTEGER ii,jj … … 199 196 fich_cas='setup/cas.nc' 200 197 print*,'fich_cas ',fich_cas 201 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)202 print*,'fich_cas, NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid203 if (ierr.NE. NF_NOERR) then198 ierr = nf90_open(fich_cas,nf90_nowrite,nid) 199 print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid 200 if (ierr.NE.nf90_noerr) then 204 201 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 205 write(*,*) NF_STRERROR(ierr)202 write(*,*) nf90_strerror(ierr) 206 203 stop "" 207 204 endif 208 205 !....................................................................... 209 ierr= NF_INQ_DIMID(nid,'lat',rid)210 IF (ierr.NE. NF_NOERR) THEN206 ierr=nf90_inq_dimid(nid,'lat',rid) 207 IF (ierr.NE.nf90_noerr) THEN 211 208 print*, 'Oh probleme lecture dimension lat' 212 209 ENDIF 213 ierr= NF_INQ_DIMLEN(nid,rid,ii)210 ierr=nf90_inquire_dimension(nid,rid,len=ii) 214 211 print*,'OK1 read2: nid,rid,lat',nid,rid,ii 215 212 !....................................................................... 216 ierr= NF_INQ_DIMID(nid,'lon',rid)217 IF (ierr.NE. NF_NOERR) THEN213 ierr=nf90_inq_dimid(nid,'lon',rid) 214 IF (ierr.NE.nf90_noerr) THEN 218 215 print*, 'Oh probleme lecture dimension lon' 219 216 ENDIF 220 ierr= NF_INQ_DIMLEN(nid,rid,jj)217 ierr=nf90_inquire_dimension(nid,rid,len=jj) 221 218 print*,'OK2 read2: nid,rid,lat',nid,rid,jj 222 219 !....................................................................... 223 ierr= NF_INQ_DIMID(nid,'nlev',rid)224 IF (ierr.NE. NF_NOERR) THEN220 ierr=nf90_inq_dimid(nid,'nlev',rid) 221 IF (ierr.NE.nf90_noerr) THEN 225 222 print*, 'Oh probleme lecture dimension nlev' 226 223 ENDIF 227 ierr= NF_INQ_DIMLEN(nid,rid,nlev_cas)224 ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas) 228 225 print*,'OK3 read2: nid,rid,nlev_cas',nid,rid,nlev_cas 229 226 !....................................................................... 230 ierr= NF_INQ_DIMID(nid,'time',rid)227 ierr=nf90_inq_dimid(nid,'time',rid) 231 228 nt_cas=0 232 IF (ierr.NE. NF_NOERR) THEN229 IF (ierr.NE.nf90_noerr) THEN 233 230 stop 'Oh probleme lecture dimension time' 234 231 ENDIF 235 ierr= NF_INQ_DIMLEN(nid,rid,nt_cas)232 ierr=nf90_inquire_dimension(nid,rid,len=nt_cas) 236 233 print*,'OK4 read2: nid,rid,nt_cas',nid,rid,nt_cas 237 234 … … 319 316 use netcdf, only: nf90_get_var 320 317 implicit none 321 322 INCLUDE "netcdf.inc"323 318 INCLUDE "date_cas.h" 324 319 … … 329 324 fich_cas='cas.nc' 330 325 print*,'fich_cas ',fich_cas 331 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)332 print*,'fich_cas, NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid333 if (ierr.NE. NF_NOERR) then326 ierr = nf90_open(fich_cas,nf90_nowrite,nid) 327 print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid 328 if (ierr.NE.nf90_noerr) then 334 329 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 335 write(*,*) NF_STRERROR(ierr)330 write(*,*) nf90_strerror(ierr) 336 331 stop "" 337 332 endif 338 333 !....................................................................... 339 ierr= NF_INQ_DIMID(nid,'lat',rid)340 IF (ierr.NE. NF_NOERR) THEN334 ierr=nf90_inq_dimid(nid,'lat',rid) 335 IF (ierr.NE.nf90_noerr) THEN 341 336 print*, 'Oh probleme lecture dimension lat' 342 337 ENDIF 343 ierr= NF_INQ_DIMLEN(nid,rid,ii)338 ierr=nf90_inquire_dimension(nid,rid,len=ii) 344 339 print*,'OK1 read2: nid,rid,lat',nid,rid,ii 345 340 !....................................................................... 346 ierr= NF_INQ_DIMID(nid,'lon',rid)347 IF (ierr.NE. NF_NOERR) THEN341 ierr=nf90_inq_dimid(nid,'lon',rid) 342 IF (ierr.NE.nf90_noerr) THEN 348 343 print*, 'Oh probleme lecture dimension lon' 349 344 ENDIF 350 ierr= NF_INQ_DIMLEN(nid,rid,jj)345 ierr=nf90_inquire_dimension(nid,rid,len=jj) 351 346 print*,'OK2 read2: nid,rid,lat',nid,rid,jj 352 347 !....................................................................... 353 ierr= NF_INQ_DIMID(nid,'lev',rid)354 IF (ierr.NE. NF_NOERR) THEN348 ierr=nf90_inq_dimid(nid,'lev',rid) 349 IF (ierr.NE.nf90_noerr) THEN 355 350 print*, 'Oh probleme lecture dimension nlev' 356 351 ENDIF 357 ierr= NF_INQ_DIMLEN(nid,rid,nlev_cas)352 ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas) 358 353 print*,'OK3 read2: nid,rid,nlev_cas',nid,rid,nlev_cas 359 354 IF ( .NOT. ( nlev_cas > 10 .AND. nlev_cas < 1000 )) THEN … … 362 357 ENDIF 363 358 !....................................................................... 364 ierr= NF_INQ_DIMID(nid,'time',rid)359 ierr=nf90_inq_dimid(nid,'time',rid) 365 360 nt_cas=0 366 IF (ierr.NE. NF_NOERR) THEN361 IF (ierr.NE.nf90_noerr) THEN 367 362 stop 'Oh probleme lecture dimension time' 368 363 ENDIF 369 ierr= NF_INQ_DIMLEN(nid,rid,nt_cas)364 ierr=nf90_inquire_dimension(nid,rid,len=nt_cas) 370 365 print*,'OK4 read2: nid,rid,nt_cas',nid,rid,nt_cas 371 366 ! Lecture de l'axe des temps 372 367 print*,'LECTURE DU TEMPS' 373 ierr= NF_INQ_VARID(nid,'time',timeid)374 if(ierr/= NF_NOERR) then368 ierr=nf90_inq_varid(nid,'time',timeid) 369 if(ierr/=nf90_noerr) then 375 370 print *,'Variable time manquante dans cas.nc:' 376 ierr= NF_NOERR371 ierr=nf90_noerr 377 372 else 378 373 allocate(time_val(nt_cas)) 379 374 ierr = NF90_GET_VAR(nid,timeid,time_val) 380 if(ierr/= NF_NOERR) then375 if(ierr/=nf90_noerr) then 381 376 print *,'Pb a la lecture de time cas.nc: ' 382 377 endif … … 541 536 542 537 !program reading forcing of the case study 543 use netcdf, only: nf90_get_var 538 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_inq_varid, nf90_inquire_dimension, nf90_strerror, nf90_open, & 539 nf90_nowrite, nf90_inq_dimid 544 540 implicit none 545 INCLUDE "netcdf.inc"546 541 547 542 integer ntime,nlevel … … 581 576 enddo 582 577 do i=1,nbvar3d 583 ierr= NF_INQ_VARID(nid,name_var(i),var3didin(i))578 ierr=nf90_inq_varid(nid,name_var(i),var3didin(i)) 584 579 print *,'ierr=',i,ierr,name_var(i),var3didin(i) 585 if(ierr/= NF_NOERR) then580 if(ierr/=nf90_noerr) then 586 581 print *,'Variable manquante dans cas.nc:',name_var(i) 587 582 endif … … 592 587 ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime]) 593 588 print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i) 594 if(ierr/= NF_NOERR) then589 if(ierr/=nf90_noerr) then 595 590 print *,'Pb a la lecture de cas.nc: ',name_var(i) 596 591 stop "getvarup" … … 599 594 print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i) 600 595 ierr = NF90_GET_VAR(nid,var3didin(i),resul1, count = [1, 1, ntime]) 601 if(ierr/= NF_NOERR) then596 if(ierr/=nf90_noerr) then 602 597 print *,'Pb a la lecture de cas.nc: ',name_var(i) 603 598 stop "getvarup" … … 658 653 659 654 !program reading forcing of the case study 660 use netcdf, only: nf90_get_var 655 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_inq_varid, nf90_inquire_dimension, nf90_strerror, nf90_open, & 656 nf90_nowrite, nf90_inq_dimid 661 657 implicit none 662 INCLUDE "netcdf.inc"663 658 664 659 integer ntime,nlevel … … 704 699 !----------------------------------------------------------------------- 705 700 do i=1,nbvar3d 706 ierr= NF_INQ_VARID(nid,name_var(i),var3didin(i))707 if(ierr/= NF_NOERR) then701 ierr=nf90_inq_varid(nid,name_var(i),var3didin(i)) 702 if(ierr/=nf90_noerr) then 708 703 print *,'Variable manquante dans cas.nc:',i,name_var(i) 709 ierr= NF_NOERR704 ierr=nf90_noerr 710 705 missing_var(i)=1 711 706 else … … 714 709 ierr = NF90_GET_VAR(nid,var3didin(i),apbp, count = [1, 1, nlevel + 1]) 715 710 print *,'read2_cas(apbp), on a lu ',i,name_var(i) 716 if(ierr/= NF_NOERR) then711 if(ierr/=nf90_noerr) then 717 712 print *,'Pb a la lecture de cas.nc: ',name_var(i) 718 713 stop "getvarup" … … 722 717 ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime]) 723 718 print *,'read2_cas(resul), on a lu ',i,name_var(i) 724 if(ierr/= NF_NOERR) then719 if(ierr/=nf90_noerr) then 725 720 print *,'Pb a la lecture de cas.nc: ',name_var(i) 726 721 stop "getvarup" … … 730 725 ierr = NF90_GET_VAR(nid,var3didin(i),resul2, count = [1, 1, ntime]) 731 726 print *,'read2_cas(resul2), on a lu ',i,name_var(i) 732 if(ierr/= NF_NOERR) then727 if(ierr/=nf90_noerr) then 733 728 print *,'Pb a la lecture de cas.nc: ',name_var(i) 734 729 stop "getvarup" … … 738 733 ierr = NF90_GET_VAR(nid,var3didin(i),resul3) 739 734 print *,'read2_cas(resul3), on a lu ',i,name_var(i) 740 if(ierr/= NF_NOERR) then735 if(ierr/=nf90_noerr) then 741 736 print *,'Pb a la lecture de cas.nc: ',name_var(i) 742 737 stop "getvarup" … … 829 824 830 825 !program reading forcing of the case study 831 use netcdf, only: nf90_get_var 826 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_inq_varid, nf90_inquire_dimension, nf90_strerror, nf90_open, & 827 nf90_nowrite, nf90_inq_dimid 832 828 implicit none 833 INCLUDE "netcdf.inc"834 829 835 830 integer ntime,nlevel,k,t … … 881 876 print*,'ON EST LA' 882 877 do i=1,nbvar3d 883 ierr= NF_INQ_VARID(nid,name_var(i),var3didin(i))884 if(ierr/= NF_NOERR) then878 ierr=nf90_inq_varid(nid,name_var(i),var3didin(i)) 879 if(ierr/=nf90_noerr) then 885 880 print *,'Variable manquante dans cas.nc:',i,name_var(i) 886 ierr= NF_NOERR881 ierr=nf90_noerr 887 882 missing_var(i)=1 888 883 else … … 891 886 ierr = NF90_GET_VAR(nid,var3didin(i),apbp) 892 887 print *,'read2_cas(apbp), on a lu ',i,name_var(i) 893 if(ierr/= NF_NOERR) then888 if(ierr/=nf90_noerr) then 894 889 print *,'Pb a la lecture de cas.nc: ',name_var(i) 895 890 stop "getvarup" … … 899 894 ierr = NF90_GET_VAR(nid,var3didin(i),resul1) 900 895 print *,'read2_cas(resul1), on a lu ',i,name_var(i) 901 if(ierr/= NF_NOERR) then896 if(ierr/=nf90_noerr) then 902 897 print *,'Pb a la lecture de cas.nc: ',name_var(i) 903 898 stop "getvarup" … … 908 903 ierr = NF90_GET_VAR(nid,var3didin(i),resul) 909 904 print *,'read2_cas(resul), on a lu ',i,name_var(i) 910 if(ierr/= NF_NOERR) then905 if(ierr/=nf90_noerr) then 911 906 print *,'Pb a la lecture de cas.nc: ',name_var(i) 912 907 stop "getvarup" … … 917 912 ierr = NF90_GET_VAR(nid,var3didin(i),resul2) 918 913 print *,'read2_cas(resul2), on a lu ',i,name_var(i) 919 if(ierr/= NF_NOERR) then914 if(ierr/=nf90_noerr) then 920 915 print *,'Pb a la lecture de cas.nc: ',name_var(i) 921 916 stop "getvarup" … … 926 921 ierr = NF90_GET_VAR(nid,var3didin(i),resul3) 927 922 print *,'read2_cas(resul3), on a lu ',i,name_var(i) 928 if(ierr/= NF_NOERR) then923 if(ierr/=nf90_noerr) then 929 924 print *,'Pb a la lecture de cas.nc: ',name_var(i) 930 925 stop "getvarup" -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.f90
r5268 r5270 3 3 ! 4 4 MODULE mod_1D_cases_read_std 5 USE netcdf, ONLY: nf90_noerr, nf90_inq_varid, nf90_inq_dimid, nf90_inquire_dimension, nf90_open, nf90_nowrite, & 6 nf90_strerror, nf90_get_var 5 7 6 8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 89 91 use netcdf, only: nf90_get_var 90 92 implicit none 91 92 INCLUDE "netcdf.inc"93 93 INCLUDE "date_cas.h" 94 94 … … 99 99 fich_cas='cas.nc' 100 100 print*,'fich_cas ',fich_cas 101 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid)102 print*,'fich_cas, NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid103 if (ierr.NE. NF_NOERR) then101 ierr = nf90_open(fich_cas,nf90_nowrite,nid) 102 print*,'fich_cas,nf90_nowrite,nid ',fich_cas,nf90_nowrite,nid 103 if (ierr.NE.nf90_noerr) then 104 104 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 105 write(*,*) NF_STRERROR(ierr)105 write(*,*) nf90_strerror(ierr) 106 106 stop "" 107 107 endif 108 108 !....................................................................... 109 ierr= NF_INQ_DIMID(nid,'lat',rid)110 IF (ierr.NE. NF_NOERR) THEN109 ierr=nf90_inq_dimid(nid,'lat',rid) 110 IF (ierr.NE.nf90_noerr) THEN 111 111 print*, 'Oh probleme lecture dimension lat' 112 112 ENDIF 113 ierr= NF_INQ_DIMLEN(nid,rid,ii)113 ierr=nf90_inquire_dimension(nid,rid,len=ii) 114 114 print*,'OK1 read_SCM_cas: nid,rid,lat',nid,rid,ii 115 115 !....................................................................... 116 ierr= NF_INQ_DIMID(nid,'lon',rid)117 IF (ierr.NE. NF_NOERR) THEN116 ierr=nf90_inq_dimid(nid,'lon',rid) 117 IF (ierr.NE.nf90_noerr) THEN 118 118 print*, 'Oh probleme lecture dimension lon' 119 119 ENDIF 120 ierr= NF_INQ_DIMLEN(nid,rid,jj)120 ierr=nf90_inquire_dimension(nid,rid,len=jj) 121 121 print*,'OK2 read_SCM_cas: nid,rid,lat',nid,rid,jj 122 122 !....................................................................... 123 ierr= NF_INQ_DIMID(nid,'lev',rid)124 IF (ierr.NE. NF_NOERR) THEN123 ierr=nf90_inq_dimid(nid,'lev',rid) 124 IF (ierr.NE.nf90_noerr) THEN 125 125 print*, 'Oh probleme lecture dimension nlev' 126 126 ENDIF 127 ierr= NF_INQ_DIMLEN(nid,rid,nlev_cas)127 ierr=nf90_inquire_dimension(nid,rid,len=nlev_cas) 128 128 print*,'OK3 read_SCM_cas: nid,rid,nlev_cas',nid,rid,nlev_cas 129 129 IF ( .NOT. ( nlev_cas > 10 .AND. nlev_cas < 200000 )) THEN … … 132 132 ENDIF 133 133 !....................................................................... 134 ierr= NF_INQ_DIMID(nid,'time',rid)134 ierr=nf90_inq_dimid(nid,'time',rid) 135 135 nt_cas=0 136 IF (ierr.NE. NF_NOERR) THEN136 IF (ierr.NE.nf90_noerr) THEN 137 137 stop 'Oh probleme lecture dimension time' 138 138 ENDIF 139 ierr= NF_INQ_DIMLEN(nid,rid,nt_cas)139 ierr=nf90_inquire_dimension(nid,rid,len=nt_cas) 140 140 print*,'OK4 read_SCM_cas: nid,rid,nt_cas',nid,rid,nt_cas 141 141 ! Lecture de l'axe des temps 142 142 print*,'LECTURE DU TEMPS' 143 ierr= NF_INQ_VARID(nid,'time',timeid)144 if(ierr/= NF_NOERR) then143 ierr=nf90_inq_varid(nid,'time',timeid) 144 if(ierr/=nf90_noerr) then 145 145 print *,'Variable time manquante dans cas.nc:' 146 ierr= NF_NOERR146 ierr=nf90_noerr 147 147 else 148 148 allocate(time_val(nt_cas)) 149 149 ierr = NF90_GET_VAR(nid,timeid,time_val) 150 if(ierr/= NF_NOERR) then150 if(ierr/=nf90_noerr) then 151 151 print *,'A Pb a la lecture de time cas.nc: ' 152 152 endif … … 331 331 use netcdf, only: nf90_get_var 332 332 implicit none 333 INCLUDE "netcdf.inc"334 333 INCLUDE "compar1d.h" 335 334 … … 414 413 415 414 416 ierr= NF_INQ_VARID(nid,'ta',int_test)417 if(ierr/= NF_NOERR) then415 ierr=nf90_inq_varid(nid,'ta',int_test) 416 if(ierr/=nf90_noerr) then 418 417 print*, '++++++++++++++++++++++++++++++' 419 418 print*, 'variable ta missing in cas.nc ' … … 431 430 do i=1,nbvar3d 432 431 missing_var(i)=0. 433 ierr= NF_INQ_VARID(nid,name_var(i),var3didin(i))432 ierr=nf90_inq_varid(nid,name_var(i),var3didin(i)) 434 433 print*, 'name_var(i)', name_var(i), var3didin(i) 435 if(ierr/= NF_NOERR) then434 if(ierr/=nf90_noerr) then 436 435 print *,'Variable manquante dans cas.nc:',i,name_var(i) 437 ierr= NF_NOERR436 ierr=nf90_noerr 438 437 missing_var(i)=1 439 438 else … … 458 457 ierr = NF90_GET_VAR(nid,var3didin(i),apbp) 459 458 print *,'read_SCM(apbp), on a lu ',i,name_var(i) 460 if(ierr/= NF_NOERR) then459 if(ierr/=nf90_noerr) then 461 460 print *,'B Pb a la lecture de cas.nc: ',name_var(i) 462 461 stop "getvarup" … … 469 468 ierr = NF90_GET_VAR(nid,var3didin(i),resul1) 470 469 print *,'read_SCM(resul1), on a lu ',i,name_var(i) 471 if(ierr/= NF_NOERR) then470 if(ierr/=nf90_noerr) then 472 471 print *,'C Pb a la lecture de cas.nc: ',name_var(i) 473 472 stop "getvarup" … … 482 481 ierr = NF90_GET_VAR(nid,var3didin(i),resul) 483 482 print *,'read_SCM(resul), on a lu ',i,name_var(i) 484 if(ierr/= NF_NOERR) then483 if(ierr/=nf90_noerr) then 485 484 print *,'D Pb a la lecture de cas.nc: ',name_var(i) 486 485 stop "getvarup" … … 494 493 ierr = NF90_GET_VAR(nid,var3didin(i),resul2) 495 494 print *,'read_SCM(resul2), on a lu ',i,name_var(i) 496 if(ierr/= NF_NOERR) then495 if(ierr/=nf90_noerr) then 497 496 print *,'E Pb a la lecture de cas.nc: ',name_var(i) 498 497 stop "getvarup" … … 506 505 ierr = NF90_GET_VAR(nid,var3didin(i),resul3) 507 506 print *,'read_SCM(resul3), on a lu ',i,name_var(i) 508 if(ierr/= NF_NOERR) then507 if(ierr/=nf90_noerr) then 509 508 print *,'F Pb a la lecture de cas.nc: ',name_var(i) 510 509 stop "getvarup" -
LMDZ6/trunk/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
r5084 r5270 146 146 !program reading forcings of the TWP-ICE experiment 147 147 148 use netcdf, only: nf90_get_var 148 USE netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,& 149 nf90_inq_dimid,nf90_inquire_dimension 149 150 150 151 implicit none 151 152 INCLUDE "netcdf.inc"153 152 154 153 integer ntime,nlevel … … 177 176 integer var3didin(nbvar3d) 178 177 179 ierr = NF_OPEN(fich_twpice,NF_NOWRITE,nid)180 if (ierr.NE. NF_NOERR) then178 ierr = nf90_open(fich_twpice,nf90_nowrite,nid) 179 if (ierr.NE.nf90_noerr) then 181 180 write(*,*) 'ERROR: Pb opening forcings cdf file ' 182 write(*,*) NF_STRERROR(ierr)181 write(*,*) nf90_strerror(ierr) 183 182 stop "" 184 183 endif 185 184 186 ierr= NF_INQ_VARID(nid,"lat",var3didin(1))187 if(ierr/= NF_NOERR) then188 write(*,*) NF_STRERROR(ierr)185 ierr=nf90_inq_varid(nid,"lat",var3didin(1)) 186 if(ierr/=nf90_noerr) then 187 write(*,*) nf90_strerror(ierr) 189 188 stop 'lat' 190 189 endif 191 190 192 ierr= NF_INQ_VARID(nid,"lon",var3didin(2))193 if(ierr/= NF_NOERR) then194 write(*,*) NF_STRERROR(ierr)191 ierr=nf90_inq_varid(nid,"lon",var3didin(2)) 192 if(ierr/=nf90_noerr) then 193 write(*,*) nf90_strerror(ierr) 195 194 stop 'lon' 196 195 endif 197 196 198 ierr= NF_INQ_VARID(nid,"alt",var3didin(3))199 if(ierr/= NF_NOERR) then200 write(*,*) NF_STRERROR(ierr)197 ierr=nf90_inq_varid(nid,"alt",var3didin(3)) 198 if(ierr/=nf90_noerr) then 199 write(*,*) nf90_strerror(ierr) 201 200 stop 'alt' 202 201 endif 203 202 204 ierr= NF_INQ_VARID(nid,"phis",var3didin(4))205 if(ierr/= NF_NOERR) then206 write(*,*) NF_STRERROR(ierr)203 ierr=nf90_inq_varid(nid,"phis",var3didin(4)) 204 if(ierr/=nf90_noerr) then 205 write(*,*) nf90_strerror(ierr) 207 206 stop 'phis' 208 207 endif 209 208 210 ierr= NF_INQ_VARID(nid,"T",var3didin(5))211 if(ierr/= NF_NOERR) then212 write(*,*) NF_STRERROR(ierr)209 ierr=nf90_inq_varid(nid,"T",var3didin(5)) 210 if(ierr/=nf90_noerr) then 211 write(*,*) nf90_strerror(ierr) 213 212 stop 'T' 214 213 endif 215 214 216 ierr= NF_INQ_VARID(nid,"q",var3didin(6))217 if(ierr/= NF_NOERR) then218 write(*,*) NF_STRERROR(ierr)215 ierr=nf90_inq_varid(nid,"q",var3didin(6)) 216 if(ierr/=nf90_noerr) then 217 write(*,*) nf90_strerror(ierr) 219 218 stop 'q' 220 219 endif 221 220 222 ierr= NF_INQ_VARID(nid,"u",var3didin(7))223 if(ierr/= NF_NOERR) then224 write(*,*) NF_STRERROR(ierr)221 ierr=nf90_inq_varid(nid,"u",var3didin(7)) 222 if(ierr/=nf90_noerr) then 223 write(*,*) nf90_strerror(ierr) 225 224 stop 'u' 226 225 endif 227 226 228 ierr= NF_INQ_VARID(nid,"v",var3didin(8))229 if(ierr/= NF_NOERR) then230 write(*,*) NF_STRERROR(ierr)227 ierr=nf90_inq_varid(nid,"v",var3didin(8)) 228 if(ierr/=nf90_noerr) then 229 write(*,*) nf90_strerror(ierr) 231 230 stop 'v' 232 231 endif 233 232 234 ierr= NF_INQ_VARID(nid,"omega",var3didin(9))235 if(ierr/= NF_NOERR) then236 write(*,*) NF_STRERROR(ierr)233 ierr=nf90_inq_varid(nid,"omega",var3didin(9)) 234 if(ierr/=nf90_noerr) then 235 write(*,*) nf90_strerror(ierr) 237 236 stop 'omega' 238 237 endif 239 238 240 ierr= NF_INQ_VARID(nid,"div",var3didin(10))241 if(ierr/= NF_NOERR) then242 write(*,*) NF_STRERROR(ierr)239 ierr=nf90_inq_varid(nid,"div",var3didin(10)) 240 if(ierr/=nf90_noerr) then 241 write(*,*) nf90_strerror(ierr) 243 242 stop 'div' 244 243 endif 245 244 246 ierr= NF_INQ_VARID(nid,"T_adv_h",var3didin(11))247 if(ierr/= NF_NOERR) then248 write(*,*) NF_STRERROR(ierr)245 ierr=nf90_inq_varid(nid,"T_adv_h",var3didin(11)) 246 if(ierr/=nf90_noerr) then 247 write(*,*) nf90_strerror(ierr) 249 248 stop 'T_adv_h' 250 249 endif 251 250 252 ierr= NF_INQ_VARID(nid,"T_adv_v",var3didin(12))253 if(ierr/= NF_NOERR) then254 write(*,*) NF_STRERROR(ierr)251 ierr=nf90_inq_varid(nid,"T_adv_v",var3didin(12)) 252 if(ierr/=nf90_noerr) then 253 write(*,*) nf90_strerror(ierr) 255 254 stop 'T_adv_v' 256 255 endif 257 256 258 ierr= NF_INQ_VARID(nid,"q_adv_h",var3didin(13))259 if(ierr/= NF_NOERR) then260 write(*,*) NF_STRERROR(ierr)257 ierr=nf90_inq_varid(nid,"q_adv_h",var3didin(13)) 258 if(ierr/=nf90_noerr) then 259 write(*,*) nf90_strerror(ierr) 261 260 stop 'q_adv_h' 262 261 endif 263 262 264 ierr= NF_INQ_VARID(nid,"q_adv_v",var3didin(14))265 if(ierr/= NF_NOERR) then266 write(*,*) NF_STRERROR(ierr)263 ierr=nf90_inq_varid(nid,"q_adv_v",var3didin(14)) 264 if(ierr/=nf90_noerr) then 265 write(*,*) nf90_strerror(ierr) 267 266 stop 'q_adv_v' 268 267 endif 269 268 270 ierr= NF_INQ_VARID(nid,"s",var3didin(15))271 if(ierr/= NF_NOERR) then272 write(*,*) NF_STRERROR(ierr)269 ierr=nf90_inq_varid(nid,"s",var3didin(15)) 270 if(ierr/=nf90_noerr) then 271 write(*,*) nf90_strerror(ierr) 273 272 stop 's' 274 273 endif 275 274 276 ierr= NF_INQ_VARID(nid,"s_adv_h",var3didin(16))277 if(ierr/= NF_NOERR) then278 write(*,*) NF_STRERROR(ierr)275 ierr=nf90_inq_varid(nid,"s_adv_h",var3didin(16)) 276 if(ierr/=nf90_noerr) then 277 write(*,*) nf90_strerror(ierr) 279 278 stop 's_adv_h' 280 279 endif 281 280 282 ierr= NF_INQ_VARID(nid,"s_adv_v",var3didin(17))283 if(ierr/= NF_NOERR) then284 write(*,*) NF_STRERROR(ierr)281 ierr=nf90_inq_varid(nid,"s_adv_v",var3didin(17)) 282 if(ierr/=nf90_noerr) then 283 write(*,*) nf90_strerror(ierr) 285 284 stop 's_adv_v' 286 285 endif 287 286 288 ierr= NF_INQ_VARID(nid,"p_srf_aver",var3didin(18))289 if(ierr/= NF_NOERR) then290 write(*,*) NF_STRERROR(ierr)287 ierr=nf90_inq_varid(nid,"p_srf_aver",var3didin(18)) 288 if(ierr/=nf90_noerr) then 289 write(*,*) nf90_strerror(ierr) 291 290 stop 'p_srf_aver' 292 291 endif 293 292 294 ierr= NF_INQ_VARID(nid,"p_srf_center",var3didin(19))295 if(ierr/= NF_NOERR) then296 write(*,*) NF_STRERROR(ierr)293 ierr=nf90_inq_varid(nid,"p_srf_center",var3didin(19)) 294 if(ierr/=nf90_noerr) then 295 write(*,*) nf90_strerror(ierr) 297 296 stop 'p_srf_center' 298 297 endif 299 298 300 ierr= NF_INQ_VARID(nid,"T_srf",var3didin(20))301 if(ierr/= NF_NOERR) then302 write(*,*) NF_STRERROR(ierr)299 ierr=nf90_inq_varid(nid,"T_srf",var3didin(20)) 300 if(ierr/=nf90_noerr) then 301 write(*,*) nf90_strerror(ierr) 303 302 stop 'T_srf' 304 303 endif … … 315 314 316 315 ierr = NF90_GET_VAR(nid,var3didin(1),lat) 317 if(ierr/= NF_NOERR) then318 write(*,*) NF_STRERROR(ierr)316 if(ierr/=nf90_noerr) then 317 write(*,*) nf90_strerror(ierr) 319 318 stop "getvarup" 320 319 endif … … 322 321 323 322 ierr = NF90_GET_VAR(nid,var3didin(2),lon) 324 if(ierr/= NF_NOERR) then325 write(*,*) NF_STRERROR(ierr)323 if(ierr/=nf90_noerr) then 324 write(*,*) nf90_strerror(ierr) 326 325 stop "getvarup" 327 326 endif … … 329 328 330 329 ierr = NF90_GET_VAR(nid,var3didin(3),alt) 331 if(ierr/= NF_NOERR) then332 write(*,*) NF_STRERROR(ierr)330 if(ierr/=nf90_noerr) then 331 write(*,*) nf90_strerror(ierr) 333 332 stop "getvarup" 334 333 endif … … 336 335 337 336 ierr = NF90_GET_VAR(nid,var3didin(4),phis) 338 if(ierr/= NF_NOERR) then339 write(*,*) NF_STRERROR(ierr)337 if(ierr/=nf90_noerr) then 338 write(*,*) nf90_strerror(ierr) 340 339 stop "getvarup" 341 340 endif … … 343 342 344 343 ierr = NF90_GET_VAR(nid,var3didin(5),T) 345 if(ierr/= NF_NOERR) then346 write(*,*) NF_STRERROR(ierr)344 if(ierr/=nf90_noerr) then 345 write(*,*) nf90_strerror(ierr) 347 346 stop "getvarup" 348 347 endif … … 350 349 351 350 ierr = NF90_GET_VAR(nid,var3didin(6),q) 352 if(ierr/= NF_NOERR) then353 write(*,*) NF_STRERROR(ierr)351 if(ierr/=nf90_noerr) then 352 write(*,*) nf90_strerror(ierr) 354 353 stop "getvarup" 355 354 endif … … 362 361 enddo 363 362 ierr = NF90_GET_VAR(nid,var3didin(7),u) 364 if(ierr/= NF_NOERR) then365 write(*,*) NF_STRERROR(ierr)363 if(ierr/=nf90_noerr) then 364 write(*,*) nf90_strerror(ierr) 366 365 stop "getvarup" 367 366 endif … … 369 368 370 369 ierr = NF90_GET_VAR(nid,var3didin(8),v) 371 if(ierr/= NF_NOERR) then372 write(*,*) NF_STRERROR(ierr)370 if(ierr/=nf90_noerr) then 371 write(*,*) nf90_strerror(ierr) 373 372 stop "getvarup" 374 373 endif … … 376 375 377 376 ierr = NF90_GET_VAR(nid,var3didin(9),omega) 378 if(ierr/= NF_NOERR) then379 write(*,*) NF_STRERROR(ierr)377 if(ierr/=nf90_noerr) then 378 write(*,*) nf90_strerror(ierr) 380 379 stop "getvarup" 381 380 endif … … 389 388 390 389 ierr = NF90_GET_VAR(nid,var3didin(10),div) 391 if(ierr/= NF_NOERR) then392 write(*,*) NF_STRERROR(ierr)390 if(ierr/=nf90_noerr) then 391 write(*,*) nf90_strerror(ierr) 393 392 stop "getvarup" 394 393 endif … … 396 395 397 396 ierr = NF90_GET_VAR(nid,var3didin(11),T_adv_h) 398 if(ierr/= NF_NOERR) then399 write(*,*) NF_STRERROR(ierr)397 if(ierr/=nf90_noerr) then 398 write(*,*) nf90_strerror(ierr) 400 399 stop "getvarup" 401 400 endif … … 410 409 411 410 ierr = NF90_GET_VAR(nid,var3didin(12),T_adv_v) 412 if(ierr/= NF_NOERR) then413 write(*,*) NF_STRERROR(ierr)411 if(ierr/=nf90_noerr) then 412 write(*,*) nf90_strerror(ierr) 414 413 stop "getvarup" 415 414 endif … … 423 422 424 423 ierr = NF90_GET_VAR(nid,var3didin(13),q_adv_h) 425 if(ierr/= NF_NOERR) then426 write(*,*) NF_STRERROR(ierr)424 if(ierr/=nf90_noerr) then 425 write(*,*) nf90_strerror(ierr) 427 426 stop "getvarup" 428 427 endif … … 437 436 438 437 ierr = NF90_GET_VAR(nid,var3didin(14),q_adv_v) 439 if(ierr/= NF_NOERR) then440 write(*,*) NF_STRERROR(ierr)438 if(ierr/=nf90_noerr) then 439 write(*,*) nf90_strerror(ierr) 441 440 stop "getvarup" 442 441 endif … … 451 450 452 451 ierr = NF90_GET_VAR(nid,var3didin(15),s) 453 if(ierr/= NF_NOERR) then454 write(*,*) NF_STRERROR(ierr)452 if(ierr/=nf90_noerr) then 453 write(*,*) nf90_strerror(ierr) 455 454 stop "getvarup" 456 455 endif 457 456 458 457 ierr = NF90_GET_VAR(nid,var3didin(16),s_adv_h) 459 if(ierr/= NF_NOERR) then460 write(*,*) NF_STRERROR(ierr)458 if(ierr/=nf90_noerr) then 459 write(*,*) nf90_strerror(ierr) 461 460 stop "getvarup" 462 461 endif 463 462 464 463 ierr = NF90_GET_VAR(nid,var3didin(17),s_adv_v) 465 if(ierr/= NF_NOERR) then466 write(*,*) NF_STRERROR(ierr)464 if(ierr/=nf90_noerr) then 465 write(*,*) nf90_strerror(ierr) 467 466 stop "getvarup" 468 467 endif 469 468 470 469 ierr = NF90_GET_VAR(nid,var3didin(18),p_srf_aver) 471 if(ierr/= NF_NOERR) then472 write(*,*) NF_STRERROR(ierr)470 if(ierr/=nf90_noerr) then 471 write(*,*) nf90_strerror(ierr) 473 472 stop "getvarup" 474 473 endif 475 474 476 475 ierr = NF90_GET_VAR(nid,var3didin(19),p_srf_center) 477 if(ierr/= NF_NOERR) then478 write(*,*) NF_STRERROR(ierr)476 if(ierr/=nf90_noerr) then 477 write(*,*) nf90_strerror(ierr) 479 478 stop "getvarup" 480 479 endif 481 480 482 481 ierr = NF90_GET_VAR(nid,var3didin(20),T_srf) 483 if(ierr/= NF_NOERR) then484 write(*,*) NF_STRERROR(ierr)482 if(ierr/=nf90_noerr) then 483 write(*,*) nf90_strerror(ierr) 485 484 stop "getvarup" 486 485 endif … … 492 491 subroutine catchaxis(nid,ttm,llm,time,lev,ierr) 493 492 494 use netcdf, only: nf90_get_var 493 USE netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,& 494 nf90_inq_dimid,nf90_inquire_dimension 495 495 496 496 implicit none 497 INCLUDE "netcdf.inc"498 497 integer nid,ttm,llm 499 498 real*8 time(ttm) … … 507 506 ! Control & lecture on dimensions 508 507 ! =============================== 509 ierr= NF_INQ_DIMID(nid,"time",timedimin)510 ierr= NF_INQ_VARID(nid,"time",timevar)511 if (ierr.NE. NF_NOERR) then508 ierr=nf90_inq_dimid(nid,"time",timedimin) 509 ierr=nf90_inq_varid(nid,"time",timevar) 510 if (ierr.NE.nf90_noerr) then 512 511 write(*,*) 'ERROR: Field <time> is missing' 513 512 stop "" 514 513 endif 515 ierr= NF_INQ_DIMLEN(nid,timedimin,timelen)516 517 ierr= NF_INQ_DIMID(nid,"lev",levdimin)518 ierr= NF_INQ_VARID(nid,"lev",levvar)519 if (ierr.NE. NF_NOERR) then514 ierr=nf90_inquire_dimension(nid,timedimin,len=timelen) 515 516 ierr=nf90_inq_dimid(nid,"lev",levdimin) 517 ierr=nf90_inq_varid(nid,"lev",levvar) 518 if (ierr.NE.nf90_noerr) then 520 519 write(*,*) 'ERROR: Field <lev> is lacking' 521 520 stop "" 522 521 endif 523 ierr= NF_INQ_DIMLEN(nid,levdimin,levlen)522 ierr=nf90_inquire_dimension(nid,levdimin,len=levlen) 524 523 525 524 if((timelen/=ttm).or.(levlen/=llm)) then … … 2169 2168 !program reading forcings of the FIRE case study 2170 2169 2171 2172 use netcdf, only: nf90_get_var2170 USE netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,& 2171 nf90_inq_dimid,nf90_inquire_dimension 2173 2172 implicit none 2174 2175 INCLUDE "netcdf.inc"2176 2173 2177 2174 integer ntime,nlevel … … 2191 2188 integer var3didin(nbvar3d) 2192 2189 2193 ierr = NF_OPEN(fich_fire,NF_NOWRITE,nid)2194 if (ierr.NE. NF_NOERR) then2190 ierr = nf90_open(fich_fire,nf90_nowrite,nid) 2191 if (ierr.NE.nf90_noerr) then 2195 2192 write(*,*) 'ERROR: Pb opening forcings nc file ' 2196 write(*,*) NF_STRERROR(ierr)2193 write(*,*) nf90_strerror(ierr) 2197 2194 stop "" 2198 2195 endif 2199 2196 2200 2197 2201 ierr= NF_INQ_VARID(nid,"zz",var3didin(1))2202 if(ierr/= NF_NOERR) then2203 write(*,*) NF_STRERROR(ierr)2198 ierr=nf90_inq_varid(nid,"zz",var3didin(1)) 2199 if(ierr/=nf90_noerr) then 2200 write(*,*) nf90_strerror(ierr) 2204 2201 stop 'lev' 2205 2202 endif 2206 2203 2207 2204 2208 ierr= NF_INQ_VARID(nid,"thetal",var3didin(2))2209 if(ierr/= NF_NOERR) then2210 write(*,*) NF_STRERROR(ierr)2205 ierr=nf90_inq_varid(nid,"thetal",var3didin(2)) 2206 if(ierr/=nf90_noerr) then 2207 write(*,*) nf90_strerror(ierr) 2211 2208 stop 'temp' 2212 2209 endif 2213 2210 2214 ierr= NF_INQ_VARID(nid,"qt",var3didin(3))2215 if(ierr/= NF_NOERR) then2216 write(*,*) NF_STRERROR(ierr)2211 ierr=nf90_inq_varid(nid,"qt",var3didin(3)) 2212 if(ierr/=nf90_noerr) then 2213 write(*,*) nf90_strerror(ierr) 2217 2214 stop 'qv' 2218 2215 endif 2219 2216 2220 ierr= NF_INQ_VARID(nid,"u",var3didin(4))2221 if(ierr/= NF_NOERR) then2222 write(*,*) NF_STRERROR(ierr)2217 ierr=nf90_inq_varid(nid,"u",var3didin(4)) 2218 if(ierr/=nf90_noerr) then 2219 write(*,*) nf90_strerror(ierr) 2223 2220 stop 'u' 2224 2221 endif 2225 2222 2226 ierr= NF_INQ_VARID(nid,"v",var3didin(5))2227 if(ierr/= NF_NOERR) then2228 write(*,*) NF_STRERROR(ierr)2223 ierr=nf90_inq_varid(nid,"v",var3didin(5)) 2224 if(ierr/=nf90_noerr) then 2225 write(*,*) nf90_strerror(ierr) 2229 2226 stop 'v' 2230 2227 endif 2231 2228 2232 ierr= NF_INQ_VARID(nid,"tke",var3didin(6))2233 if(ierr/= NF_NOERR) then2234 write(*,*) NF_STRERROR(ierr)2229 ierr=nf90_inq_varid(nid,"tke",var3didin(6)) 2230 if(ierr/=nf90_noerr) then 2231 write(*,*) nf90_strerror(ierr) 2235 2232 stop 'tke' 2236 2233 endif 2237 2234 2238 ierr= NF_INQ_VARID(nid,"ugeo",var3didin(7))2239 if(ierr/= NF_NOERR) then2240 write(*,*) NF_STRERROR(ierr)2235 ierr=nf90_inq_varid(nid,"ugeo",var3didin(7)) 2236 if(ierr/=nf90_noerr) then 2237 write(*,*) nf90_strerror(ierr) 2241 2238 stop 'ug' 2242 2239 endif 2243 2240 2244 ierr= NF_INQ_VARID(nid,"vgeo",var3didin(8))2245 if(ierr/= NF_NOERR) then2246 write(*,*) NF_STRERROR(ierr)2241 ierr=nf90_inq_varid(nid,"vgeo",var3didin(8)) 2242 if(ierr/=nf90_noerr) then 2243 write(*,*) nf90_strerror(ierr) 2247 2244 stop 'vg' 2248 2245 endif 2249 2246 2250 ierr= NF_INQ_VARID(nid,"wls",var3didin(9))2251 if(ierr/= NF_NOERR) then2252 write(*,*) NF_STRERROR(ierr)2247 ierr=nf90_inq_varid(nid,"wls",var3didin(9)) 2248 if(ierr/=nf90_noerr) then 2249 write(*,*) nf90_strerror(ierr) 2253 2250 stop 'wls' 2254 2251 endif 2255 2252 2256 ierr= NF_INQ_VARID(nid,"dqtdx",var3didin(10))2257 if(ierr/= NF_NOERR) then2258 write(*,*) NF_STRERROR(ierr)2253 ierr=nf90_inq_varid(nid,"dqtdx",var3didin(10)) 2254 if(ierr/=nf90_noerr) then 2255 write(*,*) nf90_strerror(ierr) 2259 2256 stop 'dqtdx' 2260 2257 endif 2261 2258 2262 ierr= NF_INQ_VARID(nid,"dqtdy",var3didin(11))2263 if(ierr/= NF_NOERR) then2264 write(*,*) NF_STRERROR(ierr)2259 ierr=nf90_inq_varid(nid,"dqtdy",var3didin(11)) 2260 if(ierr/=nf90_noerr) then 2261 write(*,*) nf90_strerror(ierr) 2265 2262 stop 'dqtdy' 2266 2263 endif 2267 2264 2268 ierr= NF_INQ_VARID(nid,"dqtdt",var3didin(12))2269 if(ierr/= NF_NOERR) then2270 write(*,*) NF_STRERROR(ierr)2265 ierr=nf90_inq_varid(nid,"dqtdt",var3didin(12)) 2266 if(ierr/=nf90_noerr) then 2267 write(*,*) nf90_strerror(ierr) 2271 2268 stop 'dqtdt' 2272 2269 endif 2273 2270 2274 ierr= NF_INQ_VARID(nid,"thl_rad",var3didin(13))2275 if(ierr/= NF_NOERR) then2276 write(*,*) NF_STRERROR(ierr)2271 ierr=nf90_inq_varid(nid,"thl_rad",var3didin(13)) 2272 if(ierr/=nf90_noerr) then 2273 write(*,*) nf90_strerror(ierr) 2277 2274 stop 'thl_rad' 2278 2275 endif … … 2281 2278 2282 2279 ierr = NF90_GET_VAR(nid,var3didin(1),zz) 2283 if(ierr/= NF_NOERR) then2284 write(*,*) NF_STRERROR(ierr)2280 if(ierr/=nf90_noerr) then 2281 write(*,*) nf90_strerror(ierr) 2285 2282 stop "getvarup" 2286 2283 endif … … 2288 2285 2289 2286 ierr = NF90_GET_VAR(nid,var3didin(2),thl) 2290 if(ierr/= NF_NOERR) then2291 write(*,*) NF_STRERROR(ierr)2287 if(ierr/=nf90_noerr) then 2288 write(*,*) nf90_strerror(ierr) 2292 2289 stop "getvarup" 2293 2290 endif … … 2295 2292 2296 2293 ierr = NF90_GET_VAR(nid,var3didin(3),qt) 2297 if(ierr/= NF_NOERR) then2298 write(*,*) NF_STRERROR(ierr)2294 if(ierr/=nf90_noerr) then 2295 write(*,*) nf90_strerror(ierr) 2299 2296 stop "getvarup" 2300 2297 endif … … 2302 2299 2303 2300 ierr = NF90_GET_VAR(nid,var3didin(4),u) 2304 if(ierr/= NF_NOERR) then2305 write(*,*) NF_STRERROR(ierr)2301 if(ierr/=nf90_noerr) then 2302 write(*,*) nf90_strerror(ierr) 2306 2303 stop "getvarup" 2307 2304 endif … … 2309 2306 2310 2307 ierr = NF90_GET_VAR(nid,var3didin(5),v) 2311 if(ierr/= NF_NOERR) then2312 write(*,*) NF_STRERROR(ierr)2308 if(ierr/=nf90_noerr) then 2309 write(*,*) nf90_strerror(ierr) 2313 2310 stop "getvarup" 2314 2311 endif … … 2316 2313 2317 2314 ierr = NF90_GET_VAR(nid,var3didin(6),tke) 2318 if(ierr/= NF_NOERR) then2319 write(*,*) NF_STRERROR(ierr)2315 if(ierr/=nf90_noerr) then 2316 write(*,*) nf90_strerror(ierr) 2320 2317 stop "getvarup" 2321 2318 endif … … 2323 2320 2324 2321 ierr = NF90_GET_VAR(nid,var3didin(7),ug) 2325 if(ierr/= NF_NOERR) then2326 write(*,*) NF_STRERROR(ierr)2322 if(ierr/=nf90_noerr) then 2323 write(*,*) nf90_strerror(ierr) 2327 2324 stop "getvarup" 2328 2325 endif … … 2330 2327 2331 2328 ierr = NF90_GET_VAR(nid,var3didin(8),vg) 2332 if(ierr/= NF_NOERR) then2333 write(*,*) NF_STRERROR(ierr)2329 if(ierr/=nf90_noerr) then 2330 write(*,*) nf90_strerror(ierr) 2334 2331 stop "getvarup" 2335 2332 endif … … 2337 2334 2338 2335 ierr = NF90_GET_VAR(nid,var3didin(9),wls) 2339 if(ierr/= NF_NOERR) then2340 write(*,*) NF_STRERROR(ierr)2336 if(ierr/=nf90_noerr) then 2337 write(*,*) nf90_strerror(ierr) 2341 2338 stop "getvarup" 2342 2339 endif … … 2344 2341 2345 2342 ierr = NF90_GET_VAR(nid,var3didin(10),dqtdx) 2346 if(ierr/= NF_NOERR) then2347 write(*,*) NF_STRERROR(ierr)2343 if(ierr/=nf90_noerr) then 2344 write(*,*) nf90_strerror(ierr) 2348 2345 stop "getvarup" 2349 2346 endif … … 2351 2348 2352 2349 ierr = NF90_GET_VAR(nid,var3didin(11),dqtdy) 2353 if(ierr/= NF_NOERR) then2354 write(*,*) NF_STRERROR(ierr)2350 if(ierr/=nf90_noerr) then 2351 write(*,*) nf90_strerror(ierr) 2355 2352 stop "getvarup" 2356 2353 endif … … 2358 2355 2359 2356 ierr = NF90_GET_VAR(nid,var3didin(12),dqtdt) 2360 if(ierr/= NF_NOERR) then2361 write(*,*) NF_STRERROR(ierr)2357 if(ierr/=nf90_noerr) then 2358 write(*,*) nf90_strerror(ierr) 2362 2359 stop "getvarup" 2363 2360 endif … … 2365 2362 2366 2363 ierr = NF90_GET_VAR(nid,var3didin(13),thl_rad) 2367 if(ierr/= NF_NOERR) then2368 write(*,*) NF_STRERROR(ierr)2364 if(ierr/=nf90_noerr) then 2365 write(*,*) nf90_strerror(ierr) 2369 2366 stop "getvarup" 2370 2367 endif … … 2381 2378 !program reading initial profils and forcings of the Dice case study 2382 2379 2383 use netcdf, only: nf90_get_var 2380 USE netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,& 2381 nf90_inq_dimid,nf90_inquire_dimension 2384 2382 2385 2383 implicit none 2386 2387 INCLUDE "netcdf.inc"2388 2384 INCLUDE "YOMCST.h" 2389 2385 … … 2408 2404 2409 2405 pzero=100000. 2410 ierr = NF_OPEN(fich_dice,NF_NOWRITE,nid)2411 if (ierr.NE. NF_NOERR) then2406 ierr = nf90_open(fich_dice,nf90_nowrite,nid) 2407 if (ierr.NE.nf90_noerr) then 2412 2408 write(*,*) 'ERROR: Pb opening forcings nc file ' 2413 write(*,*) NF_STRERROR(ierr)2409 write(*,*) nf90_strerror(ierr) 2414 2410 stop "" 2415 2411 endif 2416 2412 2417 2413 2418 ierr= NF_INQ_VARID(nid,"height",var3didin(1))2419 if(ierr/= NF_NOERR) then2420 write(*,*) NF_STRERROR(ierr)2414 ierr=nf90_inq_varid(nid,"height",var3didin(1)) 2415 if(ierr/=nf90_noerr) then 2416 write(*,*) nf90_strerror(ierr) 2421 2417 stop 'height' 2422 2418 endif 2423 2419 2424 ierr= NF_INQ_VARID(nid,"pf",var3didin(11))2425 if(ierr/= NF_NOERR) then2426 write(*,*) NF_STRERROR(ierr)2420 ierr=nf90_inq_varid(nid,"pf",var3didin(11)) 2421 if(ierr/=nf90_noerr) then 2422 write(*,*) nf90_strerror(ierr) 2427 2423 stop 'pf' 2428 2424 endif 2429 2425 2430 ierr= NF_INQ_VARID(nid,"theta",var3didin(12))2431 if(ierr/= NF_NOERR) then2432 write(*,*) NF_STRERROR(ierr)2426 ierr=nf90_inq_varid(nid,"theta",var3didin(12)) 2427 if(ierr/=nf90_noerr) then 2428 write(*,*) nf90_strerror(ierr) 2433 2429 stop 'theta' 2434 2430 endif 2435 2431 2436 ierr= NF_INQ_VARID(nid,"qv",var3didin(13))2437 if(ierr/= NF_NOERR) then2438 write(*,*) NF_STRERROR(ierr)2432 ierr=nf90_inq_varid(nid,"qv",var3didin(13)) 2433 if(ierr/=nf90_noerr) then 2434 write(*,*) nf90_strerror(ierr) 2439 2435 stop 'qv' 2440 2436 endif 2441 2437 2442 ierr= NF_INQ_VARID(nid,"u",var3didin(14))2443 if(ierr/= NF_NOERR) then2444 write(*,*) NF_STRERROR(ierr)2438 ierr=nf90_inq_varid(nid,"u",var3didin(14)) 2439 if(ierr/=nf90_noerr) then 2440 write(*,*) nf90_strerror(ierr) 2445 2441 stop 'u' 2446 2442 endif 2447 2443 2448 ierr= NF_INQ_VARID(nid,"v",var3didin(15))2449 if(ierr/= NF_NOERR) then2450 write(*,*) NF_STRERROR(ierr)2444 ierr=nf90_inq_varid(nid,"v",var3didin(15)) 2445 if(ierr/=nf90_noerr) then 2446 write(*,*) nf90_strerror(ierr) 2451 2447 stop 'v' 2452 2448 endif 2453 2449 2454 ierr= NF_INQ_VARID(nid,"o3mmr",var3didin(16))2455 if(ierr/= NF_NOERR) then2456 write(*,*) NF_STRERROR(ierr)2450 ierr=nf90_inq_varid(nid,"o3mmr",var3didin(16)) 2451 if(ierr/=nf90_noerr) then 2452 write(*,*) nf90_strerror(ierr) 2457 2453 stop 'o3' 2458 2454 endif 2459 2455 2460 ierr= NF_INQ_VARID(nid,"shf",var3didin(2))2461 if(ierr/= NF_NOERR) then2462 write(*,*) NF_STRERROR(ierr)2456 ierr=nf90_inq_varid(nid,"shf",var3didin(2)) 2457 if(ierr/=nf90_noerr) then 2458 write(*,*) nf90_strerror(ierr) 2463 2459 stop 'shf' 2464 2460 endif 2465 2461 2466 ierr= NF_INQ_VARID(nid,"lhf",var3didin(3))2467 if(ierr/= NF_NOERR) then2468 write(*,*) NF_STRERROR(ierr)2462 ierr=nf90_inq_varid(nid,"lhf",var3didin(3)) 2463 if(ierr/=nf90_noerr) then 2464 write(*,*) nf90_strerror(ierr) 2469 2465 stop 'lhf' 2470 2466 endif 2471 2467 2472 ierr= NF_INQ_VARID(nid,"lwup",var3didin(4))2473 if(ierr/= NF_NOERR) then2474 write(*,*) NF_STRERROR(ierr)2468 ierr=nf90_inq_varid(nid,"lwup",var3didin(4)) 2469 if(ierr/=nf90_noerr) then 2470 write(*,*) nf90_strerror(ierr) 2475 2471 stop 'lwup' 2476 2472 endif 2477 2473 2478 ierr= NF_INQ_VARID(nid,"swup",var3didin(5))2479 if(ierr/= NF_NOERR) then2480 write(*,*) NF_STRERROR(ierr)2474 ierr=nf90_inq_varid(nid,"swup",var3didin(5)) 2475 if(ierr/=nf90_noerr) then 2476 write(*,*) nf90_strerror(ierr) 2481 2477 stop 'dqtdx' 2482 2478 endif 2483 2479 2484 ierr= NF_INQ_VARID(nid,"Tg",var3didin(6))2485 if(ierr/= NF_NOERR) then2486 write(*,*) NF_STRERROR(ierr)2480 ierr=nf90_inq_varid(nid,"Tg",var3didin(6)) 2481 if(ierr/=nf90_noerr) then 2482 write(*,*) nf90_strerror(ierr) 2487 2483 stop 'Tg' 2488 2484 endif 2489 2485 2490 ierr= NF_INQ_VARID(nid,"ustar",var3didin(7))2491 if(ierr/= NF_NOERR) then2492 write(*,*) NF_STRERROR(ierr)2486 ierr=nf90_inq_varid(nid,"ustar",var3didin(7)) 2487 if(ierr/=nf90_noerr) then 2488 write(*,*) nf90_strerror(ierr) 2493 2489 stop 'ustar' 2494 2490 endif 2495 2491 2496 ierr= NF_INQ_VARID(nid,"psurf",var3didin(8))2497 if(ierr/= NF_NOERR) then2498 write(*,*) NF_STRERROR(ierr)2492 ierr=nf90_inq_varid(nid,"psurf",var3didin(8)) 2493 if(ierr/=nf90_noerr) then 2494 write(*,*) nf90_strerror(ierr) 2499 2495 stop 'psurf' 2500 2496 endif 2501 2497 2502 ierr= NF_INQ_VARID(nid,"Ug",var3didin(9))2503 if(ierr/= NF_NOERR) then2504 write(*,*) NF_STRERROR(ierr)2498 ierr=nf90_inq_varid(nid,"Ug",var3didin(9)) 2499 if(ierr/=nf90_noerr) then 2500 write(*,*) nf90_strerror(ierr) 2505 2501 stop 'Ug' 2506 2502 endif 2507 2503 2508 ierr= NF_INQ_VARID(nid,"Vg",var3didin(10))2509 if(ierr/= NF_NOERR) then2510 write(*,*) NF_STRERROR(ierr)2504 ierr=nf90_inq_varid(nid,"Vg",var3didin(10)) 2505 if(ierr/=nf90_noerr) then 2506 write(*,*) nf90_strerror(ierr) 2511 2507 stop 'Vg' 2512 2508 endif 2513 2509 2514 ierr= NF_INQ_VARID(nid,"hadvT",var3didin(17))2515 if(ierr/= NF_NOERR) then2516 write(*,*) NF_STRERROR(ierr)2510 ierr=nf90_inq_varid(nid,"hadvT",var3didin(17)) 2511 if(ierr/=nf90_noerr) then 2512 write(*,*) nf90_strerror(ierr) 2517 2513 stop 'hadvT' 2518 2514 endif 2519 2515 2520 ierr= NF_INQ_VARID(nid,"hadvq",var3didin(18))2521 if(ierr/= NF_NOERR) then2522 write(*,*) NF_STRERROR(ierr)2516 ierr=nf90_inq_varid(nid,"hadvq",var3didin(18)) 2517 if(ierr/=nf90_noerr) then 2518 write(*,*) nf90_strerror(ierr) 2523 2519 stop 'hadvq' 2524 2520 endif 2525 2521 2526 ierr= NF_INQ_VARID(nid,"hadvu",var3didin(19))2527 if(ierr/= NF_NOERR) then2528 write(*,*) NF_STRERROR(ierr)2522 ierr=nf90_inq_varid(nid,"hadvu",var3didin(19)) 2523 if(ierr/=nf90_noerr) then 2524 write(*,*) nf90_strerror(ierr) 2529 2525 stop 'hadvu' 2530 2526 endif 2531 2527 2532 ierr= NF_INQ_VARID(nid,"hadvv",var3didin(20))2533 if(ierr/= NF_NOERR) then2534 write(*,*) NF_STRERROR(ierr)2528 ierr=nf90_inq_varid(nid,"hadvv",var3didin(20)) 2529 if(ierr/=nf90_noerr) then 2530 write(*,*) nf90_strerror(ierr) 2535 2531 stop 'hadvv' 2536 2532 endif 2537 2533 2538 ierr= NF_INQ_VARID(nid,"w",var3didin(21))2539 if(ierr/= NF_NOERR) then2540 write(*,*) NF_STRERROR(ierr)2534 ierr=nf90_inq_varid(nid,"w",var3didin(21)) 2535 if(ierr/=nf90_noerr) then 2536 write(*,*) nf90_strerror(ierr) 2541 2537 stop 'w' 2542 2538 endif 2543 2539 2544 ierr= NF_INQ_VARID(nid,"omega",var3didin(22))2545 if(ierr/= NF_NOERR) then2546 write(*,*) NF_STRERROR(ierr)2540 ierr=nf90_inq_varid(nid,"omega",var3didin(22)) 2541 if(ierr/=nf90_noerr) then 2542 write(*,*) nf90_strerror(ierr) 2547 2543 stop 'omega' 2548 2544 endif … … 2551 2547 2552 2548 ierr = NF90_GET_VAR(nid,var3didin(1),zz) 2553 if(ierr/= NF_NOERR) then2554 write(*,*) NF_STRERROR(ierr)2549 if(ierr/=nf90_noerr) then 2550 write(*,*) nf90_strerror(ierr) 2555 2551 stop "getvarup" 2556 2552 endif … … 2558 2554 2559 2555 ierr = NF90_GET_VAR(nid,var3didin(11),pres) 2560 if(ierr/= NF_NOERR) then2561 write(*,*) NF_STRERROR(ierr)2556 if(ierr/=nf90_noerr) then 2557 write(*,*) nf90_strerror(ierr) 2562 2558 stop "getvarup" 2563 2559 endif … … 2565 2561 2566 2562 ierr = NF90_GET_VAR(nid,var3didin(12),th) 2567 if(ierr/= NF_NOERR) then2568 write(*,*) NF_STRERROR(ierr)2563 if(ierr/=nf90_noerr) then 2564 write(*,*) nf90_strerror(ierr) 2569 2565 stop "getvarup" 2570 2566 endif … … 2575 2571 2576 2572 ierr = NF90_GET_VAR(nid,var3didin(13),qv) 2577 if(ierr/= NF_NOERR) then2578 write(*,*) NF_STRERROR(ierr)2573 if(ierr/=nf90_noerr) then 2574 write(*,*) nf90_strerror(ierr) 2579 2575 stop "getvarup" 2580 2576 endif … … 2582 2578 2583 2579 ierr = NF90_GET_VAR(nid,var3didin(14),u) 2584 if(ierr/= NF_NOERR) then2585 write(*,*) NF_STRERROR(ierr)2580 if(ierr/=nf90_noerr) then 2581 write(*,*) nf90_strerror(ierr) 2586 2582 stop "getvarup" 2587 2583 endif … … 2589 2585 2590 2586 ierr = NF90_GET_VAR(nid,var3didin(15),v) 2591 if(ierr/= NF_NOERR) then2592 write(*,*) NF_STRERROR(ierr)2587 if(ierr/=nf90_noerr) then 2588 write(*,*) nf90_strerror(ierr) 2593 2589 stop "getvarup" 2594 2590 endif … … 2596 2592 2597 2593 ierr = NF90_GET_VAR(nid,var3didin(16),o3) 2598 if(ierr/= NF_NOERR) then2599 write(*,*) NF_STRERROR(ierr)2594 if(ierr/=nf90_noerr) then 2595 write(*,*) nf90_strerror(ierr) 2600 2596 stop "getvarup" 2601 2597 endif … … 2603 2599 2604 2600 ierr = NF90_GET_VAR(nid,var3didin(2),shf) 2605 if(ierr/= NF_NOERR) then2606 write(*,*) NF_STRERROR(ierr)2601 if(ierr/=nf90_noerr) then 2602 write(*,*) nf90_strerror(ierr) 2607 2603 stop "getvarup" 2608 2604 endif … … 2610 2606 2611 2607 ierr = NF90_GET_VAR(nid,var3didin(3),lhf) 2612 if(ierr/= NF_NOERR) then2613 write(*,*) NF_STRERROR(ierr)2608 if(ierr/=nf90_noerr) then 2609 write(*,*) nf90_strerror(ierr) 2614 2610 stop "getvarup" 2615 2611 endif … … 2617 2613 2618 2614 ierr = NF90_GET_VAR(nid,var3didin(4),lwup) 2619 if(ierr/= NF_NOERR) then2620 write(*,*) NF_STRERROR(ierr)2615 if(ierr/=nf90_noerr) then 2616 write(*,*) nf90_strerror(ierr) 2621 2617 stop "getvarup" 2622 2618 endif … … 2624 2620 2625 2621 ierr = NF90_GET_VAR(nid,var3didin(5),swup) 2626 if(ierr/= NF_NOERR) then2627 write(*,*) NF_STRERROR(ierr)2622 if(ierr/=nf90_noerr) then 2623 write(*,*) nf90_strerror(ierr) 2628 2624 stop "getvarup" 2629 2625 endif … … 2631 2627 2632 2628 ierr = NF90_GET_VAR(nid,var3didin(6),tg) 2633 if(ierr/= NF_NOERR) then2634 write(*,*) NF_STRERROR(ierr)2629 if(ierr/=nf90_noerr) then 2630 write(*,*) nf90_strerror(ierr) 2635 2631 stop "getvarup" 2636 2632 endif … … 2638 2634 2639 2635 ierr = NF90_GET_VAR(nid,var3didin(7),ustar) 2640 if(ierr/= NF_NOERR) then2641 write(*,*) NF_STRERROR(ierr)2636 if(ierr/=nf90_noerr) then 2637 write(*,*) nf90_strerror(ierr) 2642 2638 stop "getvarup" 2643 2639 endif … … 2645 2641 2646 2642 ierr = NF90_GET_VAR(nid,var3didin(8),psurf) 2647 if(ierr/= NF_NOERR) then2648 write(*,*) NF_STRERROR(ierr)2643 if(ierr/=nf90_noerr) then 2644 write(*,*) nf90_strerror(ierr) 2649 2645 stop "getvarup" 2650 2646 endif … … 2652 2648 2653 2649 ierr = NF90_GET_VAR(nid,var3didin(9),ug) 2654 if(ierr/= NF_NOERR) then2655 write(*,*) NF_STRERROR(ierr)2650 if(ierr/=nf90_noerr) then 2651 write(*,*) nf90_strerror(ierr) 2656 2652 stop "getvarup" 2657 2653 endif … … 2659 2655 2660 2656 ierr = NF90_GET_VAR(nid,var3didin(10),vg) 2661 if(ierr/= NF_NOERR) then2662 write(*,*) NF_STRERROR(ierr)2657 if(ierr/=nf90_noerr) then 2658 write(*,*) nf90_strerror(ierr) 2663 2659 stop "getvarup" 2664 2660 endif … … 2666 2662 2667 2663 ierr = NF90_GET_VAR(nid,var3didin(17),hadvt) 2668 if(ierr/= NF_NOERR) then2669 write(*,*) NF_STRERROR(ierr)2664 if(ierr/=nf90_noerr) then 2665 write(*,*) nf90_strerror(ierr) 2670 2666 stop "getvarup" 2671 2667 endif … … 2673 2669 2674 2670 ierr = NF90_GET_VAR(nid,var3didin(18),hadvq) 2675 if(ierr/= NF_NOERR) then2676 write(*,*) NF_STRERROR(ierr)2671 if(ierr/=nf90_noerr) then 2672 write(*,*) nf90_strerror(ierr) 2677 2673 stop "getvarup" 2678 2674 endif … … 2680 2676 2681 2677 ierr = NF90_GET_VAR(nid,var3didin(19),hadvu) 2682 if(ierr/= NF_NOERR) then2683 write(*,*) NF_STRERROR(ierr)2678 if(ierr/=nf90_noerr) then 2679 write(*,*) nf90_strerror(ierr) 2684 2680 stop "getvarup" 2685 2681 endif … … 2687 2683 2688 2684 ierr = NF90_GET_VAR(nid,var3didin(20),hadvv) 2689 if(ierr/= NF_NOERR) then2690 write(*,*) NF_STRERROR(ierr)2685 if(ierr/=nf90_noerr) then 2686 write(*,*) nf90_strerror(ierr) 2691 2687 stop "getvarup" 2692 2688 endif … … 2694 2690 2695 2691 ierr = NF90_GET_VAR(nid,var3didin(21),w) 2696 if(ierr/= NF_NOERR) then2697 write(*,*) NF_STRERROR(ierr)2692 if(ierr/=nf90_noerr) then 2693 write(*,*) nf90_strerror(ierr) 2698 2694 stop "getvarup" 2699 2695 endif … … 2701 2697 2702 2698 ierr = NF90_GET_VAR(nid,var3didin(22),omega) 2703 if(ierr/= NF_NOERR) then2704 write(*,*) NF_STRERROR(ierr)2699 if(ierr/=nf90_noerr) then 2700 write(*,*) nf90_strerror(ierr) 2705 2701 stop "getvarup" 2706 2702 endif … … 2715 2711 !program reading initial profils and forcings of the Gabls4 case study 2716 2712 2717 use netcdf, only: nf90_get_var 2713 USE netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,& 2714 nf90_inq_dimid,nf90_inquire_dimension 2718 2715 2719 2716 implicit none 2720 2721 INCLUDE "netcdf.inc"2722 2717 2723 2718 integer ntime,nlevel,nsol … … 2745 2740 integer var3didin(nbvar3d) 2746 2741 2747 ierr = NF_OPEN(fich_gabls4,NF_NOWRITE,nid)2748 if (ierr.NE. NF_NOERR) then2742 ierr = nf90_open(fich_gabls4,nf90_nowrite,nid) 2743 if (ierr.NE.nf90_noerr) then 2749 2744 write(*,*) 'ERROR: Pb opening forcings nc file ' 2750 write(*,*) NF_STRERROR(ierr)2745 write(*,*) nf90_strerror(ierr) 2751 2746 stop "" 2752 2747 endif 2753 2748 2754 2749 2755 ierr= NF_INQ_VARID(nid,"height",var3didin(1))2756 if(ierr/= NF_NOERR) then2757 write(*,*) NF_STRERROR(ierr)2750 ierr=nf90_inq_varid(nid,"height",var3didin(1)) 2751 if(ierr/=nf90_noerr) then 2752 write(*,*) nf90_strerror(ierr) 2758 2753 stop 'height' 2759 2754 endif 2760 2755 2761 ierr= NF_INQ_VARID(nid,"depth_sn",var3didin(2))2762 if(ierr/= NF_NOERR) then2763 write(*,*) NF_STRERROR(ierr)2756 ierr=nf90_inq_varid(nid,"depth_sn",var3didin(2)) 2757 if(ierr/=nf90_noerr) then 2758 write(*,*) nf90_strerror(ierr) 2764 2759 stop 'depth_sn' 2765 2760 endif 2766 2761 2767 ierr= NF_INQ_VARID(nid,"Ug",var3didin(3))2768 if(ierr/= NF_NOERR) then2769 write(*,*) NF_STRERROR(ierr)2762 ierr=nf90_inq_varid(nid,"Ug",var3didin(3)) 2763 if(ierr/=nf90_noerr) then 2764 write(*,*) nf90_strerror(ierr) 2770 2765 stop 'Ug' 2771 2766 endif 2772 2767 2773 ierr= NF_INQ_VARID(nid,"Vg",var3didin(4))2774 if(ierr/= NF_NOERR) then2775 write(*,*) NF_STRERROR(ierr)2768 ierr=nf90_inq_varid(nid,"Vg",var3didin(4)) 2769 if(ierr/=nf90_noerr) then 2770 write(*,*) nf90_strerror(ierr) 2776 2771 stop 'Vg' 2777 2772 endif 2778 ierr= NF_INQ_VARID(nid,"pf",var3didin(5))2779 if(ierr/= NF_NOERR) then2780 write(*,*) NF_STRERROR(ierr)2773 ierr=nf90_inq_varid(nid,"pf",var3didin(5)) 2774 if(ierr/=nf90_noerr) then 2775 write(*,*) nf90_strerror(ierr) 2781 2776 stop 'pf' 2782 2777 endif 2783 2778 2784 ierr= NF_INQ_VARID(nid,"theta",var3didin(6))2785 if(ierr/= NF_NOERR) then2786 write(*,*) NF_STRERROR(ierr)2779 ierr=nf90_inq_varid(nid,"theta",var3didin(6)) 2780 if(ierr/=nf90_noerr) then 2781 write(*,*) nf90_strerror(ierr) 2787 2782 stop 'theta' 2788 2783 endif 2789 2784 2790 ierr= NF_INQ_VARID(nid,"tempe",var3didin(7))2791 if(ierr/= NF_NOERR) then2792 write(*,*) NF_STRERROR(ierr)2785 ierr=nf90_inq_varid(nid,"tempe",var3didin(7)) 2786 if(ierr/=nf90_noerr) then 2787 write(*,*) nf90_strerror(ierr) 2793 2788 stop 'tempe' 2794 2789 endif 2795 2790 2796 ierr= NF_INQ_VARID(nid,"qv",var3didin(8))2797 if(ierr/= NF_NOERR) then2798 write(*,*) NF_STRERROR(ierr)2791 ierr=nf90_inq_varid(nid,"qv",var3didin(8)) 2792 if(ierr/=nf90_noerr) then 2793 write(*,*) nf90_strerror(ierr) 2799 2794 stop 'qv' 2800 2795 endif 2801 2796 2802 ierr= NF_INQ_VARID(nid,"u",var3didin(9))2803 if(ierr/= NF_NOERR) then2804 write(*,*) NF_STRERROR(ierr)2797 ierr=nf90_inq_varid(nid,"u",var3didin(9)) 2798 if(ierr/=nf90_noerr) then 2799 write(*,*) nf90_strerror(ierr) 2805 2800 stop 'u' 2806 2801 endif 2807 2802 2808 ierr= NF_INQ_VARID(nid,"v",var3didin(10))2809 if(ierr/= NF_NOERR) then2810 write(*,*) NF_STRERROR(ierr)2803 ierr=nf90_inq_varid(nid,"v",var3didin(10)) 2804 if(ierr/=nf90_noerr) then 2805 write(*,*) nf90_strerror(ierr) 2811 2806 stop 'v' 2812 2807 endif 2813 2808 2814 ierr= NF_INQ_VARID(nid,"hadvT",var3didin(11))2815 if(ierr/= NF_NOERR) then2816 write(*,*) NF_STRERROR(ierr)2809 ierr=nf90_inq_varid(nid,"hadvT",var3didin(11)) 2810 if(ierr/=nf90_noerr) then 2811 write(*,*) nf90_strerror(ierr) 2817 2812 stop 'hadvt' 2818 2813 endif 2819 2814 2820 ierr= NF_INQ_VARID(nid,"hadvQ",var3didin(12))2821 if(ierr/= NF_NOERR) then2822 write(*,*) NF_STRERROR(ierr)2815 ierr=nf90_inq_varid(nid,"hadvQ",var3didin(12)) 2816 if(ierr/=nf90_noerr) then 2817 write(*,*) nf90_strerror(ierr) 2823 2818 stop 'hadvq' 2824 2819 endif 2825 2820 2826 ierr= NF_INQ_VARID(nid,"Tsnow",var3didin(14))2827 if(ierr/= NF_NOERR) then2828 write(*,*) NF_STRERROR(ierr)2821 ierr=nf90_inq_varid(nid,"Tsnow",var3didin(14)) 2822 if(ierr/=nf90_noerr) then 2823 write(*,*) nf90_strerror(ierr) 2829 2824 stop 'tsnow' 2830 2825 endif 2831 2826 2832 ierr= NF_INQ_VARID(nid,"snow_density",var3didin(15))2833 if(ierr/= NF_NOERR) then2834 write(*,*) NF_STRERROR(ierr)2827 ierr=nf90_inq_varid(nid,"snow_density",var3didin(15)) 2828 if(ierr/=nf90_noerr) then 2829 write(*,*) nf90_strerror(ierr) 2835 2830 stop 'snow_density' 2836 2831 endif 2837 2832 2838 ierr= NF_INQ_VARID(nid,"Tg",var3didin(16))2839 if(ierr/= NF_NOERR) then2840 write(*,*) NF_STRERROR(ierr)2833 ierr=nf90_inq_varid(nid,"Tg",var3didin(16)) 2834 if(ierr/=nf90_noerr) then 2835 write(*,*) nf90_strerror(ierr) 2841 2836 stop 'Tg' 2842 2837 endif … … 2847 2842 2848 2843 ierr = NF90_GET_VAR(nid,var3didin(1),zz_i) 2849 if(ierr/= NF_NOERR) then2850 write(*,*) NF_STRERROR(ierr)2844 if(ierr/=nf90_noerr) then 2845 write(*,*) nf90_strerror(ierr) 2851 2846 stop "getvarup" 2852 2847 endif 2853 2848 2854 2849 ierr = NF90_GET_VAR(nid,var3didin(2),depth_sn) 2855 if(ierr/= NF_NOERR) then2856 write(*,*) NF_STRERROR(ierr)2850 if(ierr/=nf90_noerr) then 2851 write(*,*) nf90_strerror(ierr) 2857 2852 stop "getvarup" 2858 2853 endif 2859 2854 2860 2855 ierr = NF90_GET_VAR(nid,var3didin(3),ug_i) 2861 if(ierr/= NF_NOERR) then2862 write(*,*) NF_STRERROR(ierr)2856 if(ierr/=nf90_noerr) then 2857 write(*,*) nf90_strerror(ierr) 2863 2858 stop "getvarup" 2864 2859 endif 2865 2860 2866 2861 ierr = NF90_GET_VAR(nid,var3didin(4),vg_i) 2867 if(ierr/= NF_NOERR) then2868 write(*,*) NF_STRERROR(ierr)2862 if(ierr/=nf90_noerr) then 2863 write(*,*) nf90_strerror(ierr) 2869 2864 stop "getvarup" 2870 2865 endif 2871 2866 2872 2867 ierr = NF90_GET_VAR(nid,var3didin(5),pf_i) 2873 if(ierr/= NF_NOERR) then2874 write(*,*) NF_STRERROR(ierr)2868 if(ierr/=nf90_noerr) then 2869 write(*,*) nf90_strerror(ierr) 2875 2870 stop "getvarup" 2876 2871 endif 2877 2872 2878 2873 ierr = NF90_GET_VAR(nid,var3didin(6),th_i) 2879 if(ierr/= NF_NOERR) then2880 write(*,*) NF_STRERROR(ierr)2874 if(ierr/=nf90_noerr) then 2875 write(*,*) nf90_strerror(ierr) 2881 2876 stop "getvarup" 2882 2877 endif 2883 2878 2884 2879 ierr = NF90_GET_VAR(nid,var3didin(7),t_i) 2885 if(ierr/= NF_NOERR) then2886 write(*,*) NF_STRERROR(ierr)2880 if(ierr/=nf90_noerr) then 2881 write(*,*) nf90_strerror(ierr) 2887 2882 stop "getvarup" 2888 2883 endif 2889 2884 2890 2885 ierr = NF90_GET_VAR(nid,var3didin(8),qv_i) 2891 if(ierr/= NF_NOERR) then2892 write(*,*) NF_STRERROR(ierr)2886 if(ierr/=nf90_noerr) then 2887 write(*,*) nf90_strerror(ierr) 2893 2888 stop "getvarup" 2894 2889 endif 2895 2890 2896 2891 ierr = NF90_GET_VAR(nid,var3didin(9),u_i) 2897 if(ierr/= NF_NOERR) then2898 write(*,*) NF_STRERROR(ierr)2892 if(ierr/=nf90_noerr) then 2893 write(*,*) nf90_strerror(ierr) 2899 2894 stop "getvarup" 2900 2895 endif 2901 2896 2902 2897 ierr = NF90_GET_VAR(nid,var3didin(10),v_i) 2903 if(ierr/= NF_NOERR) then2904 write(*,*) NF_STRERROR(ierr)2898 if(ierr/=nf90_noerr) then 2899 write(*,*) nf90_strerror(ierr) 2905 2900 stop "getvarup" 2906 2901 endif 2907 2902 2908 2903 ierr = NF90_GET_VAR(nid,var3didin(11),hadvt_i) 2909 if(ierr/= NF_NOERR) then2910 write(*,*) NF_STRERROR(ierr)2904 if(ierr/=nf90_noerr) then 2905 write(*,*) nf90_strerror(ierr) 2911 2906 stop "getvarup" 2912 2907 endif 2913 2908 2914 2909 ierr = NF90_GET_VAR(nid,var3didin(12),hadvq_i) 2915 if(ierr/= NF_NOERR) then2916 write(*,*) NF_STRERROR(ierr)2910 if(ierr/=nf90_noerr) then 2911 write(*,*) nf90_strerror(ierr) 2917 2912 stop "getvarup" 2918 2913 endif 2919 2914 2920 2915 ierr = NF90_GET_VAR(nid,var3didin(14),tsnow) 2921 if(ierr/= NF_NOERR) then2922 write(*,*) NF_STRERROR(ierr)2916 if(ierr/=nf90_noerr) then 2917 write(*,*) nf90_strerror(ierr) 2923 2918 stop "getvarup" 2924 2919 endif 2925 2920 2926 2921 ierr = NF90_GET_VAR(nid,var3didin(15),snow_dens) 2927 if(ierr/= NF_NOERR) then2928 write(*,*) NF_STRERROR(ierr)2922 if(ierr/=nf90_noerr) then 2923 write(*,*) nf90_strerror(ierr) 2929 2924 stop "getvarup" 2930 2925 endif 2931 2926 2932 2927 ierr = NF90_GET_VAR(nid,var3didin(16),tg) 2933 if(ierr/= NF_NOERR) then2934 write(*,*) NF_STRERROR(ierr)2928 if(ierr/=nf90_noerr) then 2929 write(*,*) nf90_strerror(ierr) 2935 2930 stop "getvarup" 2936 2931 endif -
LMDZ6/trunk/libf/phylmd/dyn1d/old_1D_decl_cases.h
r5084 r5270 1 INCLUDE "netcdf.inc" 1 2 2 3 3 ! Declarations specifiques au cas Toga -
LMDZ6/trunk/libf/phylmd/inlandsis/surf_inlandsis_mod.f90
r5268 r5270 1049 1049 ! Objet: Lecture du fichier de conditions initiales pour SISVAT 1050 1050 !====================================================================== 1051 include "netcdf.inc"1052 1051 ! include "indicesol.h" 1053 1052 … … 1285 1284 1286 1285 IMPLICIT none 1287 1288 include "netcdf.inc"1289 1286 include "clesphys.h" 1290 1287 include "compbl.h" -
LMDZ6/trunk/libf/phylmd/interfoce_lim.f90
r5268 r5270 10 10 USE mod_phys_lmdz_para 11 11 USE indice_sol_mod 12 USE netcdf, ONLY: nf90_get_var 12 USE netcdf, ONLY: nf90_get_var,nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite 13 13 14 14 IMPLICIT NONE 15 16 INCLUDE "netcdf.inc"17 15 18 16 ! Cette routine sert d'interface entre le modele atmospherique et un fichier … … 116 114 117 115 fich = TRIM(fich) 118 ierr = NF_OPEN (fich, NF_NOWRITE,nid)119 IF (ierr.NE. NF_NOERR) THEN116 ierr = nf90_open (fich, nf90_nowrite,nid) 117 IF (ierr.NE.nf90_noerr) THEN 120 118 abort_message = 'Pb d''ouverture du fichier de conditions aux limites' 121 119 CALL abort_physic(modname,abort_message,1) … … 133 131 ! Fraction "ocean" 134 132 ! 135 ierr = NF_INQ_VARID(nid, 'FOCE', nvarid)136 IF (ierr /= NF_NOERR) THEN133 ierr = nf90_inq_varid(nid, 'FOCE', nvarid) 134 IF (ierr /= nf90_noerr) THEN 137 135 abort_message = 'Le champ <FOCE> est absent' 138 136 CALL abort_physic(modname,abort_message,1) 139 137 ENDIF 140 138 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_oce),start,epais) 141 IF (ierr /= NF_NOERR) THEN139 IF (ierr /= nf90_noerr) THEN 142 140 abort_message = 'Lecture echouee pour <FOCE>' 143 141 CALL abort_physic(modname,abort_message,1) … … 146 144 ! Fraction "glace de mer" 147 145 ! 148 ierr = NF_INQ_VARID(nid, 'FSIC', nvarid)149 IF (ierr /= NF_NOERR) THEN146 ierr = nf90_inq_varid(nid, 'FSIC', nvarid) 147 IF (ierr /= nf90_noerr) THEN 150 148 abort_message = 'Le champ <FSIC> est absent' 151 149 CALL abort_physic(modname,abort_message,1) 152 150 ENDIF 153 151 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_sic),start,epais) 154 IF (ierr /= NF_NOERR) THEN152 IF (ierr /= nf90_noerr) THEN 155 153 abort_message = 'Lecture echouee pour <FSIC>' 156 154 CALL abort_physic(modname,abort_message,1) … … 159 157 ! Fraction "terre" 160 158 ! 161 ierr = NF_INQ_VARID(nid, 'FTER', nvarid)162 IF (ierr /= NF_NOERR) THEN159 ierr = nf90_inq_varid(nid, 'FTER', nvarid) 160 IF (ierr /= nf90_noerr) THEN 163 161 abort_message = 'Le champ <FTER> est absent' 164 162 CALL abort_physic(modname,abort_message,1) 165 163 ENDIF 166 164 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_ter),start,epais) 167 IF (ierr /= NF_NOERR) THEN165 IF (ierr /= nf90_noerr) THEN 168 166 abort_message = 'Lecture echouee pour <FTER>' 169 167 CALL abort_physic(modname,abort_message,1) … … 172 170 ! Fraction "glacier terre" 173 171 ! 174 ierr = NF_INQ_VARID(nid, 'FLIC', nvarid)175 IF (ierr /= NF_NOERR) THEN172 ierr = nf90_inq_varid(nid, 'FLIC', nvarid) 173 IF (ierr /= nf90_noerr) THEN 176 174 abort_message = 'Le champ <FLIC> est absent' 177 175 CALL abort_physic(modname,abort_message,1) 178 176 ENDIF 179 177 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_lic),start,epais) 180 IF (ierr /= NF_NOERR) THEN178 IF (ierr /= nf90_noerr) THEN 181 179 abort_message = 'Lecture echouee pour <FLIC>' 182 180 CALL abort_physic(modname,abort_message,1) … … 185 183 ELSE ! on en est toujours a rnatur 186 184 ! 187 ierr = NF_INQ_VARID(nid, 'NAT', nvarid)188 IF (ierr /= NF_NOERR) THEN185 ierr = nf90_inq_varid(nid, 'NAT', nvarid) 186 IF (ierr /= nf90_noerr) THEN 189 187 abort_message = 'Le champ <NAT> est absent' 190 188 CALL abort_physic(modname,abort_message,1) 191 189 ENDIF 192 190 ierr = nf90_get_var(nid,nvarid,nat_lu,start,epais) 193 IF (ierr /= NF_NOERR) THEN191 IF (ierr /= nf90_noerr) THEN 194 192 abort_message = 'Lecture echouee pour <NAT>' 195 193 CALL abort_physic(modname,abort_message,1) … … 215 213 ! Lecture SST 216 214 ! 217 ierr = NF_INQ_VARID(nid, 'SST', nvarid)218 IF (ierr /= NF_NOERR) THEN215 ierr = nf90_inq_varid(nid, 'SST', nvarid) 216 IF (ierr /= nf90_noerr) THEN 219 217 abort_message = 'Le champ <SST> est absent' 220 218 CALL abort_physic(modname,abort_message,1) 221 219 ENDIF 222 220 ierr = nf90_get_var(nid,nvarid,sst_lu,start,epais) 223 IF (ierr /= NF_NOERR) THEN221 IF (ierr /= nf90_noerr) THEN 224 222 abort_message = 'Lecture echouee pour <SST>' 225 223 CALL abort_physic(modname,abort_message,1) … … 230 228 ! 231 229 !**************************************************************************************** 232 ierr = NF_CLOSE(nid)230 ierr = nf90_close(nid) 233 231 ENDIF ! is_mpi_root 234 232 -
LMDZ6/trunk/libf/phylmd/iotd_ecrit.f90
r5268 r5270 22 22 !================================================================= 23 23 24 use netcdf, only: nf90_put_var 24 USE netcdf, ONLY: nf90_put_var, nf90_inq_varid, nf90_enddef, nf90_redef, nf90_sync, nf90_noerr, & 25 nf90_float, nf90_def_var 25 26 implicit none 26 27 27 28 ! Commons 28 29 INCLUDE "netcdf.inc"30 29 INCLUDE "iotd.h" 31 30 … … 103 102 ! Get NetCDF ID of 'time' variable 104 103 105 ierr= NF_SYNC(nid)104 ierr=nf90_sync(nid) 106 105 107 ierr= NF_INQ_VARID(nid,"time",varid)106 ierr= nf90_inq_varid(nid,"time",varid) 108 107 ! Write (append) the new date to the 'time' array 109 108 … … 114 113 ! print*,'IOTD Date ,varid,nid,ntime,date',varid,nid,ntime,date 115 114 116 if (ierr.ne. NF_NOERR) then115 if (ierr.ne.nf90_noerr) then 117 116 write(*,*) "***** PUT_VAR matter in writediagfi_nc" 118 117 write(*,*) "***** with time" … … 161 160 162 161 if (ntime==1) then 163 ierr = NF_REDEF(nid)164 ierr = NF_DEF_VAR(nid,nom,NF_FLOAT,ndim,dim_cc,varid)162 ierr = nf90_redef (nid) 163 ierr = nf90_def_var(nid,nom,nf90_float,dim_cc,varid) 165 164 !print*,'DEF ',nom,nid,varid 166 ierr = NF_ENDDEF(nid)165 ierr = nf90_enddef(nid) 167 166 else 168 ierr= NF_INQ_VARID(nid,nom,varid)167 ierr= nf90_inq_varid(nid,nom,varid) 169 168 !print*,'INQ ',nom,nid,varid 170 169 ! Commandes pour recuperer automatiquement les coordonnees 171 ! ierr= NF_INQ_DIMID(nid,"longitude",id(1))170 ! ierr= nf90_inq_dimid(nid,"longitude",id(1)) 172 171 endif 173 172 … … 175 174 ierr= NF90_PUT_VAR(nid,varid,zx,corner,edges) 176 175 177 if (ierr.ne. NF_NOERR) then176 if (ierr.ne.nf90_noerr) then 178 177 write(*,*) "***** PUT_VAR problem in writediagfi" 179 178 write(*,*) "***** with ",nom -
LMDZ6/trunk/libf/phylmd/iotd_fin.f90
r5268 r5270 1 1 SUBROUTINE iotd_fin 2 USE netcdf, ONLY: nf90_close 2 3 IMPLICIT NONE 3 4 … … 12 13 ! 13 14 !======================================================================= 14 15 16 INCLUDE "netcdf.inc"17 15 INCLUDE "iotd.h" 18 16 integer ierr … … 21 19 ! ---------- 22 20 23 ierr= NF_close(nid)21 ierr=nf90_close(nid) 24 22 25 23 END -
LMDZ6/trunk/libf/phylmd/iotd_ini.f90
r5268 r5270 1 1 SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlon,prlat,pcoordv,jour0,mois0,an0,t0,timestep,calendrier) 2 USE netcdf, ONLY: nf90_enddef, nf90_put_att, nf90_float, nf90_def_var, nf90_redef, & 3 nf90_global, nf90_def_dim, nf90_create, nf90_clobber, nf90_unlimited, nf90_put_var 2 4 IMPLICIT NONE 3 5 … … 15 17 ! Declarations: 16 18 ! ------------- 17 18 INCLUDE "netcdf.inc"19 19 INCLUDE "iotd.h" 20 20 … … 90 90 91 91 ! Create the NetCDF file 92 ierr=NF_CREATE(fichnom, NF_CLOBBER, nid) 93 ierr=NF_DEF_DIM(nid, "lon", iim, dim_coord(1)) 94 ierr=NF_DEF_DIM(nid, "lat", jjm, dim_coord(2)) 95 ierr=NF_DEF_DIM(nid, "lev", llm, dim_coord(3)) 96 ierr=NF_DEF_DIM(nid,"time",NF_UNLIMITED,dim_coord(4)) 97 ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'Conventions',6,"CF-1.1") 98 !ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'file_name',TRIM(fname)) 99 ierr=NF_ENDDEF(nid) 92 ierr=nf90_create(fichnom, nf90_clobber, nid) 93 ierr=nf90_def_dim(nid, "lon", iim, dim_coord(1)) 94 ierr=nf90_def_dim(nid, "lat", jjm, dim_coord(2)) 95 ierr=nf90_def_dim(nid, "lev", llm, dim_coord(3)) 96 ierr=nf90_def_dim(nid,"time",nf90_unlimited,dim_coord(4)) 97 ierr = nf90_put_att(nid,nf90_global,'Conventions',"CF-1.1") 98 ierr=nf90_enddef(nid) 100 99 101 100 ! Switch out of NetCDF Define mode 102 101 103 102 104 ierr= NF_ENDDEF(nid)103 ierr=nf90_enddef(nid) 105 104 ! 106 105 ! Contol parameters for this run 107 106 ! ---- longitude ----------- 108 107 109 ierr= NF_REDEF(nid)110 ierr= NF_DEF_VAR(nid,"lon", NF_FLOAT, 1, dim_coord(1),nvarid)111 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'X')112 ierr= NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east")113 ierr= NF_ENDDEF(nid)114 ierr= NF_PUT_VAR_REAL(nid,nvarid,rlon)108 ierr=nf90_redef(nid) 109 ierr=nf90_def_var(nid,"lon", nf90_float, dim_coord(1),nvarid) 110 ierr = nf90_put_att(nid,nvarid,'axis','X') 111 ierr=nf90_put_att(nid,nvarid,'units',"degrees_east") 112 ierr=nf90_enddef(nid) 113 ierr=nf90_put_var(nid,nvarid,rlon) 115 114 print*,ierr 116 115 117 116 ! ---- latitude ------------ 118 ierr= NF_REDEF(nid)119 ierr= NF_DEF_VAR(nid, "lat", NF_FLOAT, 1, dim_coord(2),nvarid)120 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'Y')121 ierr= NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")122 ierr= NF_ENDDEF(nid)123 ierr= NF_PUT_VAR_REAL(nid,nvarid,rlat)117 ierr=nf90_redef(nid) 118 ierr=nf90_def_var(nid, "lat", nf90_float, dim_coord(2),nvarid) 119 ierr = nf90_put_att(nid,nvarid,'axis','Y') 120 ierr=nf90_put_att(nid,nvarid,'units',"degrees_north") 121 ierr=nf90_enddef(nid) 122 ierr=nf90_put_var(nid,nvarid,rlat) 124 123 ! 125 124 ! ---- vertical ------------ 126 ierr= NF_REDEF(nid)127 ierr= NF_DEF_VAR(nid, "lev", NF_FLOAT, 1,dim_coord(3),nvarid)128 ierr= NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"vert level")125 ierr=nf90_redef(nid) 126 ierr=nf90_def_var(nid, "lev", nf90_float, dim_coord(3),nvarid) 127 ierr=nf90_put_att(nid,nvarid,"long_name","vert level") 129 128 if ( coordv(2)>coordv(1) ) then 130 ierr= NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt")131 ierr= NF_PUT_ATT_TEXT(nid,nvarid,'positive',2,"up")129 ierr=nf90_put_att(nid,nvarid,"long_name","pseudo-alt") 130 ierr=nf90_put_att(nid,nvarid,'positive',"up") 132 131 else 133 ierr= NF_PUT_ATT_TEXT(nid,nvarid,"long_name",8,"pressure")134 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',4,"down")132 ierr=nf90_put_att(nid,nvarid,"long_name","pressure") 133 ierr = nf90_put_att (nid,nvarid,'positive',"down") 135 134 endif 136 ierr= NF_ENDDEF(nid)137 ierr= NF_PUT_VAR_REAL(nid,nvarid,coordv)135 ierr=nf90_enddef(nid) 136 ierr=nf90_put_var(nid,nvarid,coordv) 138 137 139 138 ! 140 139 ! ---- time ---------------- 141 ierr= NF_REDEF(nid)140 ierr=nf90_redef(nid) 142 141 ! Define the 'time' variable 143 ierr= NF_DEF_VAR(nid, "time", NF_FLOAT, 1, dim_coord(4),nvarid)142 ierr=nf90_def_var(nid, "time", nf90_float, dim_coord(4),nvarid) 144 143 ! ! Add attributes 145 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'T')146 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'standard_name',4,'time')144 ierr = nf90_put_att(nid,nvarid,'axis','T') 145 ierr = nf90_put_att(nid,nvarid,'standard_name','time') 147 146 WRITE(date0,'(i4.4,"-",i2.2,"-",i2.2)') an0,mois0,jour0 148 ierr= NF_PUT_ATT_TEXT(nid, nvarid,'units',33, &147 ierr=nf90_put_att(nid, nvarid,'units', & 149 148 & "seconds since "//date0//" 00:00:00") 150 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',9,calendrier)151 !ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',4,'360d')152 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'title',4,'Time')153 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'long_name',9,'Time axis')149 ierr = nf90_put_att(nid,nvarid,'calendar',calendrier) 150 !ierr = nf90_put_att(nid,nvarid,'calendar','360d') 151 ierr = nf90_put_att(nid,nvarid,'title','Time') 152 ierr = nf90_put_att(nid,nvarid,'long_name','Time axis') 154 153 WRITE(date0b,'(i4.4,"-",a3,"-",i2.2)') an0,cmois(mois0),jour0 155 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'time_origin',20, &154 ierr = nf90_put_att(nid,nvarid,'time_origin', & 156 155 & date0b//' 00:00:00') 157 ierr= NF_ENDDEF(nid)156 ierr=nf90_enddef(nid) 158 157 159 158 -
LMDZ6/trunk/libf/phylmd/phyaqua_mod.f90
r5268 r5270 517 517 IMPLICIT NONE 518 518 519 include "netcdf.inc"520 521 519 INTEGER, INTENT (IN) :: klon 522 520 REAL, INTENT (IN) :: phy_nat(klon, 360) … … 572 570 USE mod_phys_lmdz_transfert_para, ONLY: gather 573 571 USE phys_cal_mod, ONLY: year_len 574 use netcdf, only: nf90_def_var, nf90_double, nf90_float, nf90_put_var 572 USE netcdf, ONLY: nf90_def_var, nf90_put_var, nf90_get_var, nf90_strerror, nf90_close, & 573 nf90_enddef, nf90_put_att, nf90_unlimited, nf90_noerr, nf90_global, nf90_clobber, & 574 nf90_64bit_offset, nf90_def_dim, nf90_create 575 575 USE lmdz_cppkeys_wrapper, ONLY: nf90_format 576 576 IMPLICIT NONE 577 include "netcdf.inc"578 577 579 578 INTEGER, INTENT (IN) :: klon … … 606 605 PRINT *, 'writelim: Ecriture du fichier limit' 607 606 608 ierr = nf_create('limit.nc', IOR(NF_CLOBBER,NF_64BIT_OFFSET), nid) 609 610 ierr = nf_put_att_text(nid, nf_global, 'title', 30, & 611 'Fichier conditions aux limites') 612 ! ! ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim) 613 ierr = nf_def_dim(nid, 'points_physiques', klon_glo, ndim) 614 ierr = nf_def_dim(nid, 'time', nf_unlimited, ntim) 607 ierr = nf90_create('limit.nc', IOR(nf90_clobber,nf90_64bit_offset), nid) 608 609 ierr = nf90_put_att(nid, nf90_global, 'title', 'Fichier conditions aux limites') 610 ! ! ierr = nf90_def_dim (nid, "points_physiques", klon, ndim) 611 ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim) 612 ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim) 615 613 616 614 dims(1) = ndim … … 618 616 619 617 ierr = nf90_def_var(nid, 'TEMPS', nf90_format, [ntim], id_tim) 620 ierr = nf _put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee')618 ierr = nf90_put_att(nid, id_tim, 'title', 'Jour dans l annee') 621 619 622 620 ierr = nf90_def_var(nid, 'NAT', nf90_format, dims, id_nat) 623 ierr = nf_put_att_text(nid, id_nat, 'title', 23, & 624 'Nature du sol (0,1,2,3)') 621 ierr = nf90_put_att(nid, id_nat, 'title', 'Nature du sol (0,1,2,3)') 625 622 626 623 ierr = nf90_def_var(nid, 'SST', nf90_format, dims, id_sst) 627 ierr = nf_put_att_text(nid, id_sst, 'title', 35, & 628 'Temperature superficielle de la mer') 624 ierr = nf90_put_att(nid, id_sst, 'title', 'Temperature superficielle de la mer') 629 625 630 626 ierr = nf90_def_var(nid, 'BILS', nf90_format, dims, id_bils) 631 ierr = nf_put_att_text(nid, id_bils, 'title', 32, & 632 'Reference flux de chaleur au sol') 627 ierr = nf90_put_att(nid, id_bils, 'title', 'Reference flux de chaleur au sol') 633 628 634 629 ierr = nf90_def_var(nid, 'ALB', nf90_format, dims, id_alb) 635 ierr = nf _put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface')630 ierr = nf90_put_att(nid, id_alb, 'title', 'Albedo a la surface') 636 631 637 632 ierr = nf90_def_var(nid, 'RUG', nf90_format, dims, id_rug) 638 ierr = nf _put_att_text(nid, id_rug, 'title', 8, 'Rugosite')633 ierr = nf90_put_att(nid, id_rug, 'title', 'Rugosite') 639 634 640 635 ierr = nf90_def_var(nid, 'FTER', nf90_format, dims, id_fter) 641 ierr = nf _put_att_text(nid, id_fter, 'title',10,'Frac. Land')636 ierr = nf90_put_att(nid, id_fter, 'title','Frac. Land') 642 637 ierr = nf90_def_var(nid, 'FOCE', nf90_format, dims, id_foce) 643 ierr = nf _put_att_text(nid, id_foce, 'title',11,'Frac. Ocean')638 ierr = nf90_put_att(nid, id_foce, 'title','Frac. Ocean') 644 639 ierr = nf90_def_var(nid, 'FSIC', nf90_format, dims, id_fsic) 645 ierr = nf _put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice')640 ierr = nf90_put_att(nid, id_fsic, 'title','Frac. Sea Ice') 646 641 ierr = nf90_def_var(nid, 'FLIC', nf90_format, dims, id_flic) 647 ierr = nf _put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice')648 649 ierr = nf _enddef(nid)650 IF (ierr/=nf _noerr) THEN642 ierr = nf90_put_att(nid, id_flic, 'title','Frac. Land Ice') 643 644 ierr = nf90_enddef(nid) 645 IF (ierr/=nf90_noerr) THEN 651 646 WRITE (*, *) 'writelim error: failed to end define mode' 652 WRITE (*, *) nf _strerror(ierr)647 WRITE (*, *) nf90_strerror(ierr) 653 648 END IF 654 649 … … 657 652 DO k = 1, year_len 658 653 ierr = nf90_put_var(nid, id_tim, k, [k]) 659 IF (ierr/=nf _noerr) THEN654 IF (ierr/=nf90_noerr) THEN 660 655 WRITE (*, *) 'writelim error with temps(k),k=', k 661 WRITE (*, *) nf _strerror(ierr)656 WRITE (*, *) nf90_strerror(ierr) 662 657 END IF 663 658 END DO … … 670 665 IF (is_master) THEN 671 666 ierr = nf90_put_var(nid, id_nat, phy_glo) 672 IF (ierr/=nf _noerr) THEN667 IF (ierr/=nf90_noerr) THEN 673 668 WRITE (*, *) 'writelim error with phy_nat' 674 WRITE (*, *) nf _strerror(ierr)669 WRITE (*, *) nf90_strerror(ierr) 675 670 END IF 676 671 END IF … … 679 674 IF (is_master) THEN 680 675 ierr = nf90_put_var(nid, id_sst, phy_glo) 681 IF (ierr/=nf _noerr) THEN676 IF (ierr/=nf90_noerr) THEN 682 677 WRITE (*, *) 'writelim error with phy_sst' 683 WRITE (*, *) nf _strerror(ierr)678 WRITE (*, *) nf90_strerror(ierr) 684 679 END IF 685 680 END IF … … 688 683 IF (is_master) THEN 689 684 ierr = nf90_put_var(nid, id_bils, phy_glo) 690 IF (ierr/=nf _noerr) THEN685 IF (ierr/=nf90_noerr) THEN 691 686 WRITE (*, *) 'writelim error with phy_bil' 692 WRITE (*, *) nf _strerror(ierr)687 WRITE (*, *) nf90_strerror(ierr) 693 688 END IF 694 689 END IF … … 697 692 IF (is_master) THEN 698 693 ierr = nf90_put_var(nid, id_alb, phy_glo) 699 IF (ierr/=nf _noerr) THEN694 IF (ierr/=nf90_noerr) THEN 700 695 WRITE (*, *) 'writelim error with phy_alb' 701 WRITE (*, *) nf _strerror(ierr)696 WRITE (*, *) nf90_strerror(ierr) 702 697 END IF 703 698 END IF … … 706 701 IF (is_master) THEN 707 702 ierr = nf90_put_var(nid, id_rug, phy_glo) 708 IF (ierr/=nf _noerr) THEN703 IF (ierr/=nf90_noerr) THEN 709 704 WRITE (*, *) 'writelim error with phy_rug' 710 WRITE (*, *) nf _strerror(ierr)705 WRITE (*, *) nf90_strerror(ierr) 711 706 END IF 712 707 END IF … … 715 710 IF (is_master) THEN 716 711 ierr = nf90_put_var(nid, id_fter, phy_glo) 717 IF (ierr/=nf _noerr) THEN712 IF (ierr/=nf90_noerr) THEN 718 713 WRITE (*, *) 'writelim error with phy_fter' 719 WRITE (*, *) nf _strerror(ierr)714 WRITE (*, *) nf90_strerror(ierr) 720 715 END IF 721 716 END IF … … 724 719 IF (is_master) THEN 725 720 ierr = nf90_put_var(nid, id_foce, phy_glo) 726 IF (ierr/=nf _noerr) THEN721 IF (ierr/=nf90_noerr) THEN 727 722 WRITE (*, *) 'writelim error with phy_foce' 728 WRITE (*, *) nf _strerror(ierr)723 WRITE (*, *) nf90_strerror(ierr) 729 724 END IF 730 725 END IF … … 733 728 IF (is_master) THEN 734 729 ierr = nf90_put_var(nid, id_fsic, phy_glo) 735 IF (ierr/=nf _noerr) THEN730 IF (ierr/=nf90_noerr) THEN 736 731 WRITE (*, *) 'writelim error with phy_fsic' 737 WRITE (*, *) nf _strerror(ierr)732 WRITE (*, *) nf90_strerror(ierr) 738 733 END IF 739 734 END IF … … 742 737 IF (is_master) THEN 743 738 ierr = nf90_put_var(nid, id_flic, phy_glo) 744 IF (ierr/=nf _noerr) THEN739 IF (ierr/=nf90_noerr) THEN 745 740 WRITE (*, *) 'writelim error with phy_flic' 746 WRITE (*, *) nf _strerror(ierr)741 WRITE (*, *) nf90_strerror(ierr) 747 742 END IF 748 743 END IF … … 750 745 ! close file: 751 746 IF (is_master) THEN 752 ierr = nf _close(nid)747 ierr = nf90_close(nid) 753 748 END IF 754 749 -
LMDZ6/trunk/libf/phylmd/read_pstoke.f90
r5268 r5270 23 23 24 24 IMPLICIT NONE 25 26 include "netcdf.inc"27 25 28 26 INTEGER klono, klevo, imo, jmo … … 226 224 ! ID pour les dimensions 227 225 228 status = nf _inq_dimid(ncidp, 'y', yid)229 status = nf _inq_dimid(ncidp, 'x', xid)230 status = nf _inq_dimid(ncidp, 'sig_s', zid)231 status = nf _inq_dimid(ncidp, 'time_counter', tid)226 status = nf90_inq_dimid(ncidp, 'y', yid) 227 status = nf90_inq_dimid(ncidp, 'x', xid) 228 status = nf90_inq_dimid(ncidp, 'sig_s', zid) 229 status = nf90_inq_dimid(ncidp, 'time_counter', tid) 232 230 233 231 ! lecture des dimensions 234 232 235 status = nf _inq_dim(ncidp, yid, namedim, ncjm)236 status = nf _inq_dim(ncidp, xid, namedim, ncim)237 status = nf _inq_dim(ncidp, zid, namedim, ncklevo)238 status = nf _inq_dim(ncidp, tid, namedim, ncrec)233 status = nf90_inquire_dimension(ncidp, yid, namedim, ncjm) 234 status = nf90_inquire_dimension(ncidp, xid, namedim, ncim) 235 status = nf90_inquire_dimension(ncidp, zid, namedim, ncklevo) 236 status = nf90_inquire_dimension(ncidp, tid, namedim, ncrec) 239 237 240 238 zrec = ncrec -
LMDZ6/trunk/libf/phylmd/read_pstoke0.f90
r5268 r5270 22 22 23 23 IMPLICIT NONE 24 25 include "netcdf.inc"26 24 27 25 INTEGER kon, kev, zkon, zkev … … 226 224 ! ID pour les dimensions 227 225 228 status = nf _inq_dimid(ncidp, 'y', yid)229 status = nf _inq_dimid(ncidp, 'x', xid)230 status = nf _inq_dimid(ncidp, 'sig_s', zid)231 status = nf _inq_dimid(ncidp, 'time_counter', tid)226 status = nf90_inq_dimid(ncidp, 'y', yid) 227 status = nf90_inq_dimid(ncidp, 'x', xid) 228 status = nf90_inq_dimid(ncidp, 'sig_s', zid) 229 status = nf90_inq_dimid(ncidp, 'time_counter', tid) 232 230 233 231 ! lecture des dimensions 234 232 235 status = nf _inq_dim(ncidp, yid, namedim, ncjm)236 status = nf _inq_dim(ncidp, xid, namedim, ncim)237 status = nf _inq_dim(ncidp, zid, namedim, nckev)238 status = nf _inq_dim(ncidp, tid, namedim, ncrec)233 status = nf90_inquire_dimension(ncidp, yid, namedim, ncjm) 234 status = nf90_inquire_dimension(ncidp, xid, namedim, ncim) 235 status = nf90_inquire_dimension(ncidp, zid, namedim, nckev) 236 status = nf90_inquire_dimension(ncidp, tid, namedim, ncrec) 239 237 240 238 zrec = ncrec … … 253 251 ! niveaux de pression 254 252 255 status = nf _get_vara_real(ncidp, varidpl, 1, kev, pl)253 status = nf90_get_var(ncidp, varidpl, pl, [1], [kev]) 256 254 257 255 ! lecture de aire et phis -
LMDZ6/trunk/libf/phylmdiso/isotopes_routines_mod.F90
r5256 r5270 15875 15875 ! equivalent de phyetat0 pour les isotopes 15876 15876 15877 #include "netcdf.inc"15878 15877 #include "dimsoil.h" 15879 15878 #include "clesphys.h" … … 16428 16427 IMPLICIT NONE 16429 16428 16430 #include "netcdf.inc"16431 16429 #include "dimsoil.h" 16432 16430 #include "clesphys.h" -
LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90
r5249 r5270 539 539 IMPLICIT NONE 540 540 541 include "netcdf.inc"542 543 541 INTEGER, INTENT (IN) :: klon 544 542 REAL, INTENT (IN) :: phy_nat(klon, 360) … … 593 591 USE mod_phys_lmdz_transfert_para, ONLY: gather 594 592 USE phys_cal_mod, ONLY: year_len 595 USE netcdf, ONLY: nf90_put_var, nf90_def_var 593 USE netcdf, ONLY: nf90_clobber, nf90_close, nf90_noerr, nf90_strerror, nf90_put_att, nf90_def_var, & 594 nf90_def_dim, nf90_create, nf90_put_var, nf90_unlimited, nf90_global, nf90_64bit_offset, & 595 nf90_enddef 596 596 USE lmdz_cppkeys_wrapper, ONLY: nf90_format 597 597 IMPLICIT NONE 598 include "netcdf.inc"599 598 600 599 INTEGER, INTENT (IN) :: klon … … 627 626 PRINT *, 'writelim: Ecriture du fichier limit' 628 627 629 ierr = nf_create('limit.nc', IOR(NF_CLOBBER,NF_64BIT_OFFSET), nid) 630 631 ierr = nf_put_att_text(nid, nf_global, 'title', 30, & 632 'Fichier conditions aux limites') 633 ! ! ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim) 634 ierr = nf_def_dim(nid, 'points_physiques', klon_glo, ndim) 635 ierr = nf_def_dim(nid, 'time', nf_unlimited, ntim) 628 ierr = nf90_create('limit.nc', IOR(nf90_clobber,nf90_64bit_offset), nid) 629 630 ierr = nf90_put_att(nid, nf90_global, 'title', 'Fichier conditions aux limites') 631 ! ! ierr = nf90_def_dim (nid, "points_physiques", klon, ndim) 632 ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim) 633 ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim) 636 634 637 635 dims(1) = ndim … … 639 637 640 638 ierr = nf90_def_var(nid, 'TEMPS', nf90_format, ntim, id_tim) 641 ierr = nf _put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee')639 ierr = nf90_put_att(nid, id_tim, 'title', 'Jour dans l annee') 642 640 643 641 ierr = nf90_def_var(nid, 'NAT', nf90_format, dims, id_nat) 644 ierr = nf_put_att_text(nid, id_nat, 'title', 23, & 645 'Nature du sol (0,1,2,3)') 642 ierr = nf90_put_att(nid, id_nat, 'title', 'Nature du sol (0,1,2,3)') 646 643 647 644 ierr = nf90_def_var(nid, 'SST', nf90_format, dims, id_sst) 648 ierr = nf_put_att_text(nid, id_sst, 'title', 35, & 649 'Temperature superficielle de la mer') 645 ierr = nf90_put_att(nid, id_sst, 'title', 'Temperature superficielle de la mer') 650 646 651 647 ierr = nf90_def_var(nid, 'BILS', nf90_format, dims, id_bils) 652 ierr = nf_put_att_text(nid, id_bils, 'title', 32, & 653 'Reference flux de chaleur au sol') 648 ierr = nf90_put_att(nid, id_bils, 'title', 'Reference flux de chaleur au sol') 654 649 655 650 ierr = nf90_def_var(nid, 'ALB', nf90_format, dims, id_alb) 656 ierr = nf _put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface')651 ierr = nf90_put_att(nid, id_alb, 'title', 'Albedo a la surface') 657 652 658 653 ierr = nf90_def_var(nid, 'RUG', nf90_format, dims, id_rug) 659 ierr = nf _put_att_text(nid, id_rug, 'title', 8, 'Rugosite')654 ierr = nf90_put_att(nid, id_rug, 'title', 'Rugosite') 660 655 661 656 ierr = nf90_def_var(nid, 'FTER', nf90_format, dims, id_fter) 662 ierr = nf _put_att_text(nid, id_fter, 'title',10,'Frac. Land')657 ierr = nf90_put_att(nid, id_fter, 'title','Frac. Land') 663 658 ierr = nf90_def_var(nid, 'FOCE', nf90_format, dims, id_foce) 664 ierr = nf _put_att_text(nid, id_foce, 'title',11,'Frac. Ocean')659 ierr = nf90_put_att(nid, id_foce, 'title','Frac. Ocean') 665 660 ierr = nf90_def_var(nid, 'FSIC', nf90_format, dims, id_fsic) 666 ierr = nf _put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice')661 ierr = nf90_put_att(nid, id_fsic, 'title','Frac. Sea Ice') 667 662 ierr = nf90_def_var(nid, 'FLIC', nf90_format, dims, id_flic) 668 ierr = nf _put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice')669 670 ierr = nf _enddef(nid)671 IF (ierr/=nf _noerr) THEN663 ierr = nf90_put_att(nid, id_flic, 'title','Frac. Land Ice') 664 665 ierr = nf90_enddef(nid) 666 IF (ierr/=nf90_noerr) THEN 672 667 WRITE (*, *) 'writelim error: failed to end define mode' 673 WRITE (*, *) nf _strerror(ierr)668 WRITE (*, *) nf90_strerror(ierr) 674 669 END IF 675 670 … … 678 673 DO k = 1, year_len 679 674 ierr = nf90_put_var(nid, id_tim, k, [k]) 680 IF (ierr/=nf _noerr) THEN675 IF (ierr/=nf90_noerr) THEN 681 676 WRITE (*, *) 'writelim error with temps(k),k=', k 682 WRITE (*, *) nf _strerror(ierr)677 WRITE (*, *) nf90_strerror(ierr) 683 678 END IF 684 679 END DO … … 691 686 IF (is_master) THEN 692 687 ierr = nf90_put_var(nid, id_nat, phy_glo) 693 IF (ierr/=nf _noerr) THEN688 IF (ierr/=nf90_noerr) THEN 694 689 WRITE (*, *) 'writelim error with phy_nat' 695 WRITE (*, *) nf _strerror(ierr)690 WRITE (*, *) nf90_strerror(ierr) 696 691 END IF 697 692 END IF … … 700 695 IF (is_master) THEN 701 696 ierr = nf90_put_var(nid, id_sst, phy_glo) 702 IF (ierr/=nf _noerr) THEN697 IF (ierr/=nf90_noerr) THEN 703 698 WRITE (*, *) 'writelim error with phy_sst' 704 WRITE (*, *) nf _strerror(ierr)699 WRITE (*, *) nf90_strerror(ierr) 705 700 END IF 706 701 END IF … … 709 704 IF (is_master) THEN 710 705 ierr = nf90_put_var(nid, id_bils, phy_glo) 711 IF (ierr/=nf _noerr) THEN706 IF (ierr/=nf90_noerr) THEN 712 707 WRITE (*, *) 'writelim error with phy_bil' 713 WRITE (*, *) nf _strerror(ierr)708 WRITE (*, *) nf90_strerror(ierr) 714 709 END IF 715 710 END IF … … 718 713 IF (is_master) THEN 719 714 ierr = nf90_put_var(nid, id_alb, phy_glo) 720 IF (ierr/=nf _noerr) THEN715 IF (ierr/=nf90_noerr) THEN 721 716 WRITE (*, *) 'writelim error with phy_alb' 722 WRITE (*, *) nf _strerror(ierr)717 WRITE (*, *) nf90_strerror(ierr) 723 718 END IF 724 719 END IF … … 727 722 IF (is_master) THEN 728 723 ierr = nf90_put_var(nid, id_rug, phy_glo) 729 IF (ierr/=nf _noerr) THEN724 IF (ierr/=nf90_noerr) THEN 730 725 WRITE (*, *) 'writelim error with phy_rug' 731 WRITE (*, *) nf _strerror(ierr)726 WRITE (*, *) nf90_strerror(ierr) 732 727 END IF 733 728 END IF … … 736 731 IF (is_master) THEN 737 732 ierr = nf90_put_var(nid, id_fter, phy_glo) 738 IF (ierr/=nf _noerr) THEN733 IF (ierr/=nf90_noerr) THEN 739 734 WRITE (*, *) 'writelim error with phy_fter' 740 WRITE (*, *) nf _strerror(ierr)735 WRITE (*, *) nf90_strerror(ierr) 741 736 END IF 742 737 END IF … … 745 740 IF (is_master) THEN 746 741 ierr = nf90_put_var(nid, id_foce, phy_glo) 747 IF (ierr/=nf _noerr) THEN742 IF (ierr/=nf90_noerr) THEN 748 743 WRITE (*, *) 'writelim error with phy_foce' 749 WRITE (*, *) nf _strerror(ierr)744 WRITE (*, *) nf90_strerror(ierr) 750 745 END IF 751 746 END IF … … 754 749 IF (is_master) THEN 755 750 ierr = nf90_put_var(nid, id_fsic, phy_glo) 756 IF (ierr/=nf _noerr) THEN751 IF (ierr/=nf90_noerr) THEN 757 752 WRITE (*, *) 'writelim error with phy_fsic' 758 WRITE (*, *) nf _strerror(ierr)753 WRITE (*, *) nf90_strerror(ierr) 759 754 END IF 760 755 END IF … … 763 758 IF (is_master) THEN 764 759 ierr = nf90_put_var(nid, id_flic, phy_glo) 765 IF (ierr/=nf _noerr) THEN760 IF (ierr/=nf90_noerr) THEN 766 761 WRITE (*, *) 'writelim error with phy_flic' 767 WRITE (*, *) nf _strerror(ierr)762 WRITE (*, *) nf90_strerror(ierr) 768 763 END IF 769 764 END IF … … 771 766 ! close file: 772 767 IF (is_master) THEN 773 ierr = nf _close(nid)768 ierr = nf90_close(nid) 774 769 END IF 775 770
Note: See TracChangeset
for help on using the changeset viewer.