Changeset 5073
- Timestamp:
- Jul 18, 2024, 4:57:05 PM (7 weeks ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dynphy_lonlat/phylmd/limit_netcdf.F90
r4467 r5073 80 80 USE comconst_mod, ONLY: pi 81 81 USE phys_cal_mod, ONLY: calend 82 USE lmdz_netcdf, ONLY: NF90_FORMAT 82 83 IMPLICIT NONE 83 84 !------------------------------------------------------------------------------- … … 107 108 INTEGER :: id_tim, id_SST, id_BILS, id_RUG, id_ALB 108 109 INTEGER :: id_FOCE, id_FSIC, id_FTER, id_FLIC, varid_longitude, varid_latitude 109 INTEGER :: NF90_FORMAT110 110 INTEGER :: ndays !--- Depending on the output calendar 111 111 CHARACTER(LEN=ns) :: str 112 112 113 113 !--- INITIALIZATIONS ----------------------------------------------------------- 114 #ifdef NC_DOUBLE115 NF90_FORMAT=NF90_DOUBLE116 #else117 NF90_FORMAT=NF90_FLOAT118 #endif119 114 CALL inigeom 120 115 -
LMDZ6/trunk/libf/misc/lmdz_netcdf.F90
r5071 r5073 3 3 ! It serves two primary functions: 4 4 ! 1) Turn netcdf into a "real" fortran module, without the INCLUDE call 5 ! 2) Handle the NC_DOUBLE CPP key. Ideally, this key should ONLY appear here (WIP). TODO5 ! 2) Handle the NC_DOUBLE CPP key. This key should ONLY be used here. 6 6 ! Ideally, the "real" netcdf module/headers should ONLY be called here. (WIP) TODO 7 7 ! --------------------------------------------- 8 ! TODO check that none of the wrapped functions remain elsewhere9 8 ! TODO check all uses of `use netcdf` + netcdf.inc 10 9 … … 15 14 ! Note: as we want to expose netcdf through this module, we don't make all PRIVATE by default as usual 16 15 ! Instead, explicitely make PRIVATE the relevant items. 17 PRIVATE CPP_NC_DOUBLE18 16 19 17 INCLUDE 'netcdf.inc' 20 18 21 19 #ifdef NC_DOUBLE 22 LOGICAL, PARAMETER :: CPP_NC_DOUBLE = .TRUE. ! Define a variable to reduce use of preprocessor ahead23 20 INTEGER, PARAMETER :: NF90_FORMAT = NF90_DOUBLE 24 INTEGER, PARAMETER :: REAL_FORMAT = REAL6425 21 #else 26 LOGICAL, PARAMETER :: CPP_NC_DOUBLE = .FALSE.27 22 INTEGER, PARAMETER :: NF90_FORMAT = NF90_FLOAT 28 INTEGER, PARAMETER :: REAL_FORMAT = REAL3229 23 #endif 30 CONTAINS31 32 24 END MODULE lmdz_netcdf -
LMDZ6/trunk/libf/phylmd/Dust/condsurfc.F
r4593 r5073 24 24 INTEGER debut(2),epais(2) 25 25 ! 26 IF (jour .LT.0 .OR. jour.GT.(360-1)) THEN27 IF (jour .GT.(360-1).AND.jour.LE.367) THEN26 IF (jour<0 .OR. jour>(360-1)) THEN 27 IF (jour>(360-1).AND.jour<=367) THEN 28 28 jour=360-1 29 29 print *,'JE: jour changed to jour= ',jour … … 35 35 ! 36 36 ierr = NF_OPEN ("limitcarbon.nc", NF_NOWRITE, nid1) 37 if (ierr .ne.NF_NOERR) then37 if (ierr/=NF_NOERR) then 38 38 write(6,*)' Pb d''ouverture du fichier limitbc.nc' 39 39 write(6,*)' ierr = ', ierr … … 49 49 ! 50 50 ierr = NF_INQ_VARID (nid1, "BCFF", nvarid) 51 !nhl #ifdef NC_DOUBLE 52 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcff) 51 ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais) 53 52 ! print *,'IERR = ',ierr 54 53 ! print *,'NF_NOERR = ',NF_NOERR 55 54 ! print *,'debut = ',debut 56 55 ! print *,'epais = ',epais 57 !nhl #else 58 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcff) 59 !nhl #endif 60 IF (ierr .NE. NF_NOERR) THEN 56 IF (ierr /= NF_NOERR) THEN 61 57 PRINT*, 'Pb de lecture pour les sources BC' 62 58 CALL exit(1) … … 65 61 ! 66 62 ierr = NF_INQ_VARID (nid1, "BCBB", nvarid) 67 !nhl #ifdef NC_DOUBLE 68 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbb) 69 !nhl #else 70 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbb) 71 !nhl #endif 72 IF (ierr .NE. NF_NOERR) THEN 63 ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais) 64 IF (ierr /= NF_NOERR) THEN 73 65 PRINT*, 'Pb de lecture pour les sources BC-biomass' 74 66 CALL exit(1) … … 77 69 ! 78 70 ierr = NF_INQ_VARID (nid1, "BCBL", nvarid) 79 !nhl #ifdef NC_DOUBLE 80 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbl) 81 !nhl #else 82 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbl) 83 !nhl #endif 84 IF (ierr .NE. NF_NOERR) THEN 71 ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais) 72 IF (ierr /= NF_NOERR) THEN 85 73 PRINT*, 'Pb de lecture pour les sources BC low' 86 74 CALL exit(1) … … 89 77 ! 90 78 ierr = NF_INQ_VARID (nid1, "BCBH", nvarid) 91 !nhl #ifdef NC_DOUBLE 92 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbh) 93 !nhl #else 94 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbh) 95 !nhl #endif 96 IF (ierr .NE. NF_NOERR) THEN 79 ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh, debut, epais) 80 IF (ierr /= NF_NOERR) THEN 97 81 PRINT*, 'Pb de lecture pour les sources BC high' 98 82 CALL exit(1) … … 100 84 ! 101 85 ierr = NF_INQ_VARID (nid1, "TERP", nvarid) 102 !nhl #ifdef NC_DOUBLE 103 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_terp) 104 !nhl #else 105 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_terp) 106 !nhl #endif 107 IF (ierr .NE. NF_NOERR) THEN 86 ierr = nf90_get_var (nid1, nvarid, lmt_terp, debut, epais) 87 IF (ierr /= NF_NOERR) THEN 108 88 PRINT*, 'Pb de lecture pour les sources Terpene' 109 89 CALL exit(1) … … 112 92 ! 113 93 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 94 ierr = nf90_get_var (nid1, nvarid, lmt_bc_penner, debut, epais) 95 IF (ierr /= NF_NOERR) THEN 122 96 PRINT*, 'Pb de lecture pour les sources BC Penner' 123 97 CALL exit(1) … … 126 100 ! 127 101 ierr = NF_INQ_VARID (nid1, "OMFF", nvarid) 128 !nhl #ifdef NC_DOUBLE 129 ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_omff) 130 !nhl #else 131 !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_omff) 132 !nhl #endif 133 IF (ierr .NE. NF_NOERR) THEN 102 ierr = nf90_get_var (nid1, nvarid, lmt_omff, debut, epais) 103 IF (ierr /= NF_NOERR) THEN 134 104 PRINT*, 'Pb de lecture pour les sources om-ifossil' 135 105 CALL exit(1) -
LMDZ6/trunk/libf/phylmd/Dust/condsurfs.F
r4593 r5073 24 24 INTEGER debut(2),epais(2) 25 25 c 26 IF (jour .LT.0 .OR. jour.GT.(360-1)) THEN27 IF ((jour .GT.(360-1)) .AND. (jour.LE.367)) THEN26 IF (jour<0 .OR. jour>(360-1)) THEN 27 IF ((jour>(360-1)) .AND. (jour<=367)) THEN 28 28 jour=360-1 29 29 print *,'JE: jour changed to jour= ',jour … … 35 35 c 36 36 ierr = NF_OPEN ("limitsoufre.nc", NF_NOWRITE, nid) 37 if (ierr .ne.NF_NOERR) then37 if (ierr/=NF_NOERR) then 38 38 write(6,*)' Pb d''ouverture du fichier limitsoufre.nc' 39 39 write(6,*)' ierr = ', ierr … … 48 48 c 49 49 ierr = NF_INQ_VARID (nid, "VOLC", nvarid) 50 cnhl #ifdef NC_DOUBLE 51 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2volc) 52 cnhl #else 53 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2volc) 54 cnhl #endif 55 IF (ierr .NE. NF_NOERR) THEN 50 ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais) 51 IF (ierr /= NF_NOERR) THEN 56 52 PRINT*, 'Pb de lecture pour les sources so2 volcan' 57 53 CALL exit(1) … … 59 55 c 60 56 ierr = NF_INQ_VARID (nid, "ALTI", nvarid) 61 cnhl #ifdef NC_DOUBLE 62 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_altvolc) 63 cnhl #else 64 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_altvolc) 65 cnhl #endif 66 IF (ierr .NE. NF_NOERR) THEN 57 ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais) 58 IF (ierr /= NF_NOERR) THEN 67 59 PRINT*, 'Pb de lecture pour les altitudes volcan' 68 60 CALL exit(1) … … 72 64 c 73 65 ierr = NF_INQ_VARID (nid, "SO2ED95L", nvarid) 74 cnhl #ifdef NC_DOUBLE 75 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b) 76 cnhl #else 77 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b) 78 cnhl #endif 79 IF (ierr .NE. NF_NOERR) THEN 66 ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 67 IF (ierr /= NF_NOERR) THEN 80 68 PRINT*, 'Pb de lecture pour les sources so2 edgar low' 81 69 CALL exit(1) … … 83 71 c 84 72 ierr = NF_INQ_VARID (nid, "SO2ED95H", nvarid) 85 cnhl #ifdef NC_DOUBLE 86 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h) 87 cnhl #else 88 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h) 89 cnhl #endif 90 IF (ierr .NE. NF_NOERR) THEN 73 ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 74 IF (ierr /= NF_NOERR) THEN 91 75 PRINT*, 'Pb de lecture pour les sources so2 edgar high' 92 76 CALL exit(1) … … 96 80 c 97 81 ierr = NF_INQ_VARID (nid, "SO2H", nvarid) 98 cnhl #ifdef NC_DOUBLE 99 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h) 100 cnhl #else 101 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h) 102 cnhl #endif 103 IF (ierr .NE. NF_NOERR) THEN 82 ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) 83 IF (ierr /= NF_NOERR) THEN 104 84 PRINT*, 'Pb de lecture pour les sources so2 haut' 105 85 CALL exit(1) … … 107 87 c 108 88 ierr = NF_INQ_VARID (nid, "SO2B", nvarid) 109 cnhl #ifdef NC_DOUBLE 110 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b) 111 cnhl #else 112 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b) 113 cnhl #endif 114 IF (ierr .NE. NF_NOERR) THEN 89 ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) 90 IF (ierr /= NF_NOERR) THEN 115 91 PRINT*, 'Pb de lecture pour les sources so2 bas' 116 92 CALL exit(1) … … 120 96 c 121 97 ierr = NF_INQ_VARID (nid, "SO2BB", nvarid) 122 cnhl #ifdef NC_DOUBLE 123 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2bb) 124 cnhl #else 125 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2bb) 126 cnhl #endif 127 IF (ierr .NE. NF_NOERR) THEN 98 ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais) 99 IF (ierr /= NF_NOERR) THEN 128 100 PRINT*, 'Pb de lecture pour les sources so2 bb' 129 101 CALL exit(1) … … 131 103 c 132 104 ierr = NF_INQ_VARID (nid, "SO2BA", nvarid) 133 cnhl #ifdef NC_DOUBLE 134 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2ba) 135 cnhl #else 136 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2ba) 137 cnhl #endif 138 IF (ierr .NE. NF_NOERR) THEN 105 ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais) 106 IF (ierr /= NF_NOERR) THEN 139 107 PRINT*, 'Pb de lecture pour les sources so2 bateau' 140 108 CALL exit(1) … … 142 110 c 143 111 ierr = NF_INQ_VARID (nid, "DMSB", nvarid) 144 cnhl #ifdef NC_DOUBLE 145 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dmsbio) 146 cnhl #else 147 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsbio) 148 cnhl #endif 149 IF (ierr .NE. NF_NOERR) THEN 112 ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais) 113 IF (ierr /= NF_NOERR) THEN 150 114 PRINT*, 'Pb de lecture pour les sources dms bio' 151 115 CALL exit(1) … … 153 117 c 154 118 ierr = NF_INQ_VARID (nid, "H2SB", nvarid) 155 cnhl #ifdef NC_DOUBLE 156 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_h2sbio) 157 cnhl #else 158 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_h2sbio) 159 cnhl #endif 160 IF (ierr .NE. NF_NOERR) THEN 119 ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais) 120 IF (ierr /= NF_NOERR) THEN 161 121 PRINT*, 'Pb de lecture pour les sources h2s bio' 162 122 CALL exit(1) 163 123 ENDIF 164 124 c 165 IF (flag_dms .EQ.1) THEN125 IF (flag_dms==1) THEN 166 126 c 167 127 ierr = NF_INQ_VARID (nid, "DMSL", nvarid) 168 cnhl #ifdef NC_DOUBLE 169 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms) 170 cnhl #else 171 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms) 172 cnhl #endif 173 IF (ierr .NE. NF_NOERR) THEN 128 ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 129 IF (ierr /= NF_NOERR) THEN 174 130 PRINT*, 'Pb de lecture pour les sources dms liss' 175 131 CALL exit(1) 176 132 ENDIF 177 133 c 178 ELSEIF (flag_dms .EQ.2) THEN134 ELSEIF (flag_dms==2) THEN 179 135 c 180 136 ierr = NF_INQ_VARID (nid, "DMSW", nvarid) 181 cnhl #ifdef NC_DOUBLE 182 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms) 183 cnhl #else 184 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms) 185 cnhl #endif 186 IF (ierr .NE. NF_NOERR) THEN 137 ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) 138 IF (ierr /= NF_NOERR) THEN 187 139 PRINT*, 'Pb de lecture pour les sources dms wann' 188 140 CALL exit(1) 189 141 ENDIF 190 142 c 191 ELSEIF (flag_dms .EQ.3) THEN143 ELSEIF (flag_dms==3) THEN 192 144 c 193 145 ierr = NF_INQ_VARID (nid, "DMSC1", nvarid) 194 cnhl #ifdef NC_DOUBLE 195 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 196 cnhl #else 197 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 198 cnhl #endif 199 IF (ierr .NE. NF_NOERR) THEN 146 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 147 IF (ierr /= NF_NOERR) THEN 200 148 PRINT*, 'Pb de lecture pour les sources dmsconc old' 201 149 CALL exit(1) 202 150 ENDIF 203 151 c 204 ELSEIF (flag_dms .EQ.4) THEN152 ELSEIF (flag_dms==4) THEN 205 153 c 206 154 ierr = NF_INQ_VARID (nid, "DMSC2", nvarid) 207 cnhl #ifdef NC_DOUBLE 208 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 209 cnhl #else 210 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 211 cnhl #endif 212 IF (ierr .NE. NF_NOERR) THEN 155 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 156 IF (ierr /= NF_NOERR) THEN 213 157 PRINT*, 'Pb de lecture pour les sources dms conc 2' 214 158 CALL exit(1) 215 159 ENDIF 216 160 c 217 ELSEIF (flag_dms .EQ.5) THEN161 ELSEIF (flag_dms==5) THEN 218 162 c 219 163 ierr = NF_INQ_VARID (nid, "DMSC3", nvarid) 220 cnhl #ifdef NC_DOUBLE 221 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 222 cnhl #else 223 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 224 cnhl #endif 225 IF (ierr .NE. NF_NOERR) THEN 164 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 165 IF (ierr /= NF_NOERR) THEN 226 166 PRINT*, 'Pb de lecture pour les sources dms conc 3' 227 167 CALL exit(1) 228 168 ENDIF 229 169 c 230 ELSEIF (flag_dms .EQ.6) THEN170 ELSEIF (flag_dms==6) THEN 231 171 c 232 172 ierr = NF_INQ_VARID (nid, "DMSC4", nvarid) 233 cnhl #ifdef NC_DOUBLE 234 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 235 cnhl #else 236 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 237 cnhl #endif 238 IF (ierr .NE. NF_NOERR) THEN 173 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 174 IF (ierr /= NF_NOERR) THEN 239 175 PRINT*, 'Pb de lecture pour les sources dms conc 4' 240 176 CALL exit(1) 241 177 ENDIF 242 178 c 243 ELSEIF (flag_dms .EQ.7) THEN179 ELSEIF (flag_dms==7) THEN 244 180 c 245 181 ierr = NF_INQ_VARID (nid, "DMSC5", nvarid) 246 cnhl #ifdef NC_DOUBLE 247 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 248 cnhl #else 249 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 250 cnhl #endif 251 IF (ierr .NE. NF_NOERR) THEN 182 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 183 IF (ierr /= NF_NOERR) THEN 252 184 PRINT*, 'Pb de lecture pour les sources dms conc 5' 253 185 CALL exit(1) 254 186 ENDIF 255 187 c 256 ELSEIF (flag_dms .EQ.8) THEN188 ELSEIF (flag_dms==8) THEN 257 189 c 258 190 ierr = NF_INQ_VARID (nid, "DMSC6", nvarid) 259 cnhl #ifdef NC_DOUBLE 260 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 261 cnhl #else 262 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 263 cnhl #endif 264 IF (ierr .NE. NF_NOERR) THEN 191 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 192 IF (ierr /= NF_NOERR) THEN 265 193 PRINT*, 'Pb de lecture pour les sources dms conc 6' 266 194 CALL exit(1) 267 195 ENDIF 268 196 c 269 ELSEIF (flag_dms .EQ.9) THEN197 ELSEIF (flag_dms==9) THEN 270 198 c 271 199 ierr = NF_INQ_VARID (nid, "DMSC7", nvarid) 272 cnhl #ifdef NC_DOUBLE 273 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 274 cnhl #else 275 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 276 cnhl #endif 277 IF (ierr .NE. NF_NOERR) THEN 200 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 201 IF (ierr /= NF_NOERR) THEN 278 202 PRINT*, 'Pb de lecture pour les sources dms conc 7' 279 203 CALL exit(1) 280 204 ENDIF 281 205 c 282 ELSEIF (flag_dms .EQ.10) THEN206 ELSEIF (flag_dms==10) THEN 283 207 c 284 208 ierr = NF_INQ_VARID (nid, "DMSC8", nvarid) 285 cnhl #ifdef NC_DOUBLE 286 ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) 287 cnhl #else 288 cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) 289 cnhl #endif 290 IF (ierr .NE. NF_NOERR) THEN 209 ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) 210 IF (ierr /= NF_NOERR) THEN 291 211 PRINT*, 'Pb de lecture pour les sources dms conc 8' 292 212 CALL exit(1) … … 302 222 ierr = NF_CLOSE(nid) 303 223 c 304 IF (flag_dms .LE.2) THEN224 IF (flag_dms<=2) THEN 305 225 DO i=1, klon 306 226 lmt_dmsconc(i)=0.0 -
LMDZ6/trunk/libf/phylmd/Dust/read_dust.F
r4593 r5073 46 46 start(3)=step 47 47 c 48 #ifdef NC_DOUBLE49 48 ! status=NF_GET_VARA_DOUBLE(ncid1,varid1,start,count,dust_nc) 50 status=NF_GET_VARA_DOUBLE(ncid1,varid1,start,count,dust_nc_glo) 51 #else 52 ! status=NF_GET_VARA_REAL(ncid1,varid1,start,count,dust_nc) 53 status=NF_GET_VARA_REAL(ncid1,varid1,start,count,dust_nc_glo) 54 #endif 49 status=nf90_get_var(ncid1,varid1,dust_nc_glo,start,count) 55 50 c 56 51 ! call correctbid(iim,jjp1,dust_nc) -
LMDZ6/trunk/libf/phylmd/Dust/read_surface.F90
r4593 r5073 65 65 ! print *,'stat,i',status,i,outcycle,aux4s 66 66 ! print *,'ifclause',status.NE. NF_NOERR ,outcycle == .false. 67 IF ((.not.(status .NE.NF_NOERR) ).and.( .not. outcycle )) THEN67 IF ((.not.(status/= NF_NOERR) ).and.( .not. outcycle )) THEN 68 68 outcycle=.true. 69 69 latstr=aux4s … … 75 75 varid=NCVID(ncid,latstr,rcode) 76 76 77 #ifdef NC_DOUBLE 78 status=NF_GET_VARA_DOUBLE(ncid,varid,startj,endj,lats_glo) 79 #else 80 status=NF_GET_VARA_REAL(ncid,varid,startj,endj,lats_glo) 81 #endif 77 status=nf90_get_var(ncid,varid,lats_glo,startj,endj) 82 78 ! print *,latstr,varid,status,jjp1,rcode 83 79 ! IF (status .NE. NF_NOERR) print*,'NOOOOOOO' … … 113 109 ! Lecture 114 110 ! ----------------------- 115 #ifdef NC_DOUBLE 116 status=NF_GET_VARA_DOUBLE(ncid,varid,start,count,tmp_dyn_glo) 117 #else 118 status=NF_GET_VARA_REAL(ncid,varid,start,count,tmp_dyn_glo) 119 #endif 111 status=nf90_get_var(ncid,varid,tmp_dyn_glo,start,count) 120 112 121 113 ! call dump2d(iip1,jjp1,tmp_dyn,'tmp_dyn ') -
LMDZ6/trunk/libf/phylmd/Dust/read_vent.F
r4593 r5073 51 51 c 52 52 start(3)=step 53 c 54 #ifdef NC_DOUBLE 55 ! status=NF_GET_VARA_DOUBLE(ncidu1,varidu1,start,count,u10m_nc) 56 status=NF_GET_VARA_DOUBLE(ncidu1,varidu1,start,count,u10m_nc_glo) 57 #else 58 ! status=NF_GET_VARA_REAL(ncidu1,varidu1,start,count,u10m_nc) 59 status=NF_GET_VARA_REAL(ncidu1,varidu1,start,count,u10m_nc_glo) 60 #endif 61 ! print *,status 62 c 63 #ifdef NC_DOUBLE 64 ! status=NF_GET_VARA_DOUBLE(ncidv1,varidv1,start,count,v10m_nc) 65 status=NF_GET_VARA_DOUBLE(ncidv1,varidv1,start,count,v10m_nc_glo) 66 #else 67 ! status=NF_GET_VARA_REAL(ncidv1,varidv1,start,count,v10m_nc) 68 status=NF_GET_VARA_REAL(ncidv1,varidv1,start,count,v10m_nc_glo) 69 #endif 70 c 53 54 status=nf90_get_var(ncidu1,varidu1,u10m_nc_glo,start,count) 55 56 status=nf90_get_var(ncidv1,varidv1,v10m_nc_glo,start,count) 57 71 58 72 59 ! print *,'beforebidcor u10m_nc', u10m_nc(1,jjp1) … … 131 118 do l=1,nl 132 119 do i=2,iim-1 133 if(abs(x(i,l)) .gt.1.e10) then120 if(abs(x(i,l))>1.e10) then 134 121 zz=0.5*(x(i-1,l)+x(i+1,l)) 135 122 c print*,'correction ',i,l,x(i,l),zz -
LMDZ6/trunk/libf/phylmd/condsurf.F90
r3102 r5073 7 7 USE indice_sol_mod 8 8 USE time_phylmdz_mod, ONLY: annee_ref 9 USE lmdz_netcdf 9 10 IMPLICIT NONE 10 11 … … 20 21 ! lmt_bils: bilan chaleur au sol (a utiliser pour "slab-ocean") 21 22 22 include "netcdf.inc"23 23 INTEGER nid, nvarid 24 24 INTEGER debut(2) … … 110 110 END IF 111 111 PRINT *, 'debut,epais', debut, epais, 'jour,jourvrai', jour, jourvrai 112 #ifdef NC_DOUBLE 113 ierr = nf_get_vara_double(nid, nvarid, debut, epais, lmt_bils_glo) 114 #else 115 ierr = nf_get_vara_real(nid, nvarid, debut, epais, lmt_bils_glo) 116 #endif 112 ierr = nf90_get_var(nid, nvarid, lmt_bils_glo, debut, epais) 117 113 IF (ierr/=nf_noerr) THEN 118 114 CALL abort_physic('condsurf', 'Lecture echouee pour <BILS>', 1) -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_amma_read.F90
r4593 r5073 67 67 ierr = NF_OPEN(fich_amma,NF_NOWRITE,nid) 68 68 print*,'fich_amma,NF_NOWRITE,nid ',fich_amma,NF_NOWRITE,nid 69 if (ierr .NE.NF_NOERR) then69 if (ierr/=NF_NOERR) then 70 70 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 71 71 write(*,*) NF_STRERROR(ierr) … … 74 74 !....................................................................... 75 75 ierr=NF_INQ_DIMID(nid,'lev',rid) 76 IF (ierr .NE.NF_NOERR) THEN76 IF (ierr/=NF_NOERR) THEN 77 77 print*, 'Oh probleme lecture dimension zz' 78 78 ENDIF … … 83 83 print*,'nid,rid',nid,rid 84 84 nt_amma=0 85 IF (ierr .NE.NF_NOERR) THEN85 IF (ierr/=NF_NOERR) THEN 86 86 stop 'probleme lecture dimension sens' 87 87 ENDIF … … 268 268 ! call catchaxis(nid,ntime,nlevel,time,z,ierr) 269 269 270 #ifdef NC_DOUBLE 271 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz) 272 #else 273 ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz) 274 #endif 270 ierr = nf90_get_var(nid,var3didin(1),zz) 275 271 if(ierr/=NF_NOERR) then 276 272 write(*,*) NF_STRERROR(ierr) … … 279 275 ! write(*,*)'lecture z ok',zz 280 276 281 #ifdef NC_DOUBLE 282 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),temp) 283 #else 284 ierr = NF_GET_VAR_REAL(nid,var3didin(2),temp) 285 #endif 277 ierr = nf90_get_var(nid,var3didin(2),temp) 286 278 if(ierr/=NF_NOERR) then 287 279 write(*,*) NF_STRERROR(ierr) … … 290 282 ! write(*,*)'lecture th ok',temp 291 283 292 #ifdef NC_DOUBLE 293 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),qv) 294 #else 295 ierr = NF_GET_VAR_REAL(nid,var3didin(3),qv) 296 #endif 284 ierr = nf90_get_var(nid,var3didin(3),qv) 297 285 if(ierr/=NF_NOERR) then 298 286 write(*,*) NF_STRERROR(ierr) … … 301 289 ! write(*,*)'lecture qv ok',qv 302 290 303 #ifdef NC_DOUBLE 304 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),u) 305 #else 306 ierr = NF_GET_VAR_REAL(nid,var3didin(4),u) 307 #endif 291 ierr = nf90_get_var(nid,var3didin(4),u) 308 292 if(ierr/=NF_NOERR) then 309 293 write(*,*) NF_STRERROR(ierr) … … 312 296 ! write(*,*)'lecture u ok',u 313 297 314 #ifdef NC_DOUBLE 315 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),v) 316 #else 317 ierr = NF_GET_VAR_REAL(nid,var3didin(5),v) 318 #endif 298 ierr = nf90_get_var(nid,var3didin(5),v) 319 299 if(ierr/=NF_NOERR) then 320 300 write(*,*) NF_STRERROR(ierr) … … 323 303 ! write(*,*)'lecture v ok',v 324 304 325 #ifdef NC_DOUBLE 326 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),dw) 327 #else 328 ierr = NF_GET_VAR_REAL(nid,var3didin(6),dw) 329 #endif 305 ierr = nf90_get_var(nid,var3didin(6),dw) 330 306 if(ierr/=NF_NOERR) then 331 307 write(*,*) NF_STRERROR(ierr) … … 334 310 ! write(*,*)'lecture w ok',dw 335 311 336 #ifdef NC_DOUBLE 337 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),dt) 338 #else 339 ierr = NF_GET_VAR_REAL(nid,var3didin(7),dt) 340 #endif 312 ierr = nf90_get_var(nid,var3didin(7),dt) 341 313 if(ierr/=NF_NOERR) then 342 314 write(*,*) NF_STRERROR(ierr) … … 345 317 ! write(*,*)'lecture dt ok',dt 346 318 347 #ifdef NC_DOUBLE 348 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),dq) 349 #else 350 ierr = NF_GET_VAR_REAL(nid,var3didin(8),dq) 351 #endif 319 ierr = nf90_get_var(nid,var3didin(8),dq) 352 320 if(ierr/=NF_NOERR) then 353 321 write(*,*) NF_STRERROR(ierr) … … 356 324 ! write(*,*)'lecture dq ok',dq 357 325 358 #ifdef NC_DOUBLE 359 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),sens) 360 #else 361 ierr = NF_GET_VAR_REAL(nid,var3didin(9),sens) 362 #endif 326 ierr = nf90_get_var(nid,var3didin(9),sens) 363 327 if(ierr/=NF_NOERR) then 364 328 write(*,*) NF_STRERROR(ierr) … … 367 331 ! write(*,*)'lecture sens ok',sens 368 332 369 #ifdef NC_DOUBLE 370 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),flat) 371 #else 372 ierr = NF_GET_VAR_REAL(nid,var3didin(10),flat) 373 #endif 333 ierr = nf90_get_var(nid,var3didin(10),flat) 374 334 if(ierr/=NF_NOERR) then 375 335 write(*,*) NF_STRERROR(ierr) … … 378 338 ! write(*,*)'lecture flat ok',flat 379 339 380 #ifdef NC_DOUBLE 381 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),pp) 382 #else 383 ierr = NF_GET_VAR_REAL(nid,var3didin(11),pp) 384 #endif 340 ierr = nf90_get_var(nid,var3didin(11),pp) 385 341 if(ierr/=NF_NOERR) then 386 342 write(*,*) NF_STRERROR(ierr) … … 429 385 430 386 431 if (forcing_type .eq.6) then387 if (forcing_type==6) then 432 388 ! Check that initial day of the simulation consistent with AMMA case: 433 if (annee_ref .ne.2006) then389 if (annee_ref/=2006) then 434 390 print*,'Pour AMMA, annee_ref doit etre 2006' 435 391 print*,'Changer annee_ref dans run.def' 436 392 stop 437 393 endif 438 if (annee_ref .eq.2006 .and. day1.lt.day_ini_amma) then439 print*,'AMMA a d ébutéle 10 juillet 2006',day1,day_ini_amma394 if (annee_ref==2006 .and. day1<day_ini_amma) then 395 print*,'AMMA a d�but� le 10 juillet 2006',day1,day_ini_amma 440 396 print*,'Changer dayref dans run.def' 441 397 stop 442 398 endif 443 if (annee_ref .eq.2006 .and. day1.gt.day_ini_amma+1) then399 if (annee_ref==2006 .and. day1>day_ini_amma+1) then 444 400 print*,'AMMA a fini le 11 juillet' 445 401 print*,'Changer dayref ou nday dans run.def' … … 464 420 465 421 it_amma1=INT(timeit/dt_amma)+1 466 IF (it_amma1 .EQ.nt_amma) THEN422 IF (it_amma1 == nt_amma) THEN 467 423 it_amma2=it_amma1 468 424 ELSE … … 472 428 time_amma2=(it_amma2-1)*dt_amma 473 429 474 if (it_amma1 .gt.nt_amma) then430 if (it_amma1 > nt_amma) then 475 431 write(*,*) 'PB-stop: day, it_amma1, it_amma2, timeit: ' & 476 432 & ,day,day_ini_amma,it_amma1,it_amma2,timeit/86400. … … 479 435 480 436 ! time interpolation: 481 IF (it_amma1 .EQ.it_amma2) THEN437 IF (it_amma1 == it_amma2) THEN 482 438 frac=0. 483 439 ELSE -
LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read.F90
r4593 r5073 99 99 ierr = NF_OPEN(fich_cas,NF_NOWRITE,nid) 100 100 print*,'fich_cas,NF_NOWRITE,nid ',fich_cas,NF_NOWRITE,nid 101 if (ierr .NE.NF_NOERR) then101 if (ierr/=NF_NOERR) then 102 102 write(*,*) 'ERROR: GROS Pb opening forcings nc file ' 103 103 write(*,*) NF_STRERROR(ierr) … … 106 106 !....................................................................... 107 107 ierr=NF_INQ_DIMID(nid,'lat',rid) 108 IF (ierr .NE.NF_NOERR) THEN108 IF (ierr/=NF_NOERR) THEN 109 109 print*, 'Oh probleme lecture dimension lat' 110 110 ENDIF … … 113 113 !....................................................................... 114 114 ierr=NF_INQ_DIMID(nid,'lon',rid) 115 IF (ierr .NE.NF_NOERR) THEN115 IF (ierr/=NF_NOERR) THEN 116 116 print*, 'Oh probleme lecture dimension lon' 117 117 ENDIF … … 120 120 !....................................................................... 121 121 ierr=NF_INQ_DIMID(nid,'lev',rid) 122 IF (ierr .NE.NF_NOERR) THEN122 IF (ierr/=NF_NOERR) THEN 123 123 print*, 'Oh probleme lecture dimension zz' 124 124 ENDIF … … 129 129 print*,'nid,rid',nid,rid 130 130 nt_cas=0 131 IF (ierr .NE.NF_NOERR) THEN131 IF (ierr/=NF_NOERR) THEN 132 132 stop 'probleme lecture dimension sens' 133 133 ENDIF … … 532 532 endif 533 533 534 #ifdef NC_DOUBLE 535 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz) 536 #else 537 ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz) 538 #endif 534 ierr = nf90_get_var(nid,var3didin(1),zz) 539 535 if(ierr/=NF_NOERR) then 540 536 write(*,*) NF_STRERROR(ierr) … … 543 539 ! write(*,*)'lecture z ok',zz 544 540 545 #ifdef NC_DOUBLE 546 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),pp) 547 #else 548 ierr = NF_GET_VAR_REAL(nid,var3didin(2),pp) 549 #endif 541 ierr = nf90_get_var(nid,var3didin(2),pp) 550 542 if(ierr/=NF_NOERR) then 551 543 write(*,*) NF_STRERROR(ierr) … … 555 547 556 548 557 #ifdef NC_DOUBLE 558 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),temp) 559 #else 560 ierr = NF_GET_VAR_REAL(nid,var3didin(3),temp) 561 #endif 549 ierr = nf90_get_var(nid,var3didin(3),temp) 562 550 if(ierr/=NF_NOERR) then 563 551 write(*,*) NF_STRERROR(ierr) … … 566 554 ! write(*,*)'lecture T ok',temp 567 555 568 #ifdef NC_DOUBLE 569 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),qv) 570 #else 571 ierr = NF_GET_VAR_REAL(nid,var3didin(4),qv) 572 #endif 556 ierr = nf90_get_var(nid,var3didin(4),qv) 573 557 if(ierr/=NF_NOERR) then 574 558 write(*,*) NF_STRERROR(ierr) … … 577 561 ! write(*,*)'lecture qv ok',qv 578 562 579 #ifdef NC_DOUBLE 580 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),rh) 581 #else 582 ierr = NF_GET_VAR_REAL(nid,var3didin(5),rh) 583 #endif 563 ierr = nf90_get_var(nid,var3didin(5),rh) 584 564 if(ierr/=NF_NOERR) then 585 565 write(*,*) NF_STRERROR(ierr) … … 588 568 ! write(*,*)'lecture rh ok',rh 589 569 590 #ifdef NC_DOUBLE 591 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),theta) 592 #else 593 ierr = NF_GET_VAR_REAL(nid,var3didin(6),theta) 594 #endif 570 ierr = nf90_get_var(nid,var3didin(6),theta) 595 571 if(ierr/=NF_NOERR) then 596 572 write(*,*) NF_STRERROR(ierr) … … 599 575 ! write(*,*)'lecture theta ok',theta 600 576 601 #ifdef NC_DOUBLE 602 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),rv) 603 #else 604 ierr = NF_GET_VAR_REAL(nid,var3didin(7),rv) 605 #endif 577 ierr = nf90_get_var(nid,var3didin(7),rv) 606 578 if(ierr/=NF_NOERR) then 607 579 write(*,*) NF_STRERROR(ierr) … … 610 582 ! write(*,*)'lecture rv ok',rv 611 583 612 #ifdef NC_DOUBLE 613 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),u) 614 #else 615 ierr = NF_GET_VAR_REAL(nid,var3didin(8),u) 616 #endif 584 ierr = nf90_get_var(nid,var3didin(8),u) 617 585 if(ierr/=NF_NOERR) then 618 586 write(*,*) NF_STRERROR(ierr) … … 621 589 ! write(*,*)'lecture u ok',u 622 590 623 #ifdef NC_DOUBLE 624 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),v) 625 #else 626 ierr = NF_GET_VAR_REAL(nid,var3didin(9),v) 627 #endif 591 ierr = nf90_get_var(nid,var3didin(9),v) 628 592 if(ierr/=NF_NOERR) then 629 593 write(*,*) NF_STRERROR(ierr) … … 632 596 ! write(*,*)'lecture v ok',v 633 597 634 #ifdef NC_DOUBLE 635 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),ug) 636 #else 637 ierr = NF_GET_VAR_REAL(nid,var3didin(10),ug) 638 #endif 598 ierr = nf90_get_var(nid,var3didin(10),ug) 639 599 if(ierr/=NF_NOERR) then 640 600 write(*,*) NF_STRERROR(ierr) … … 643 603 ! write(*,*)'lecture ug ok',ug 644 604 645 #ifdef NC_DOUBLE 646 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),vg) 647 #else 648 ierr = NF_GET_VAR_REAL(nid,var3didin(11),vg) 649 #endif 605 ierr = nf90_get_var(nid,var3didin(11),vg) 650 606 if(ierr/=NF_NOERR) then 651 607 write(*,*) NF_STRERROR(ierr) … … 654 610 ! write(*,*)'lecture vg ok',vg 655 611 656 #ifdef NC_DOUBLE 657 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),w) 658 #else 659 ierr = NF_GET_VAR_REAL(nid,var3didin(12),w) 660 #endif 612 ierr = nf90_get_var(nid,var3didin(12),w) 661 613 if(ierr/=NF_NOERR) then 662 614 write(*,*) NF_STRERROR(ierr) … … 665 617 ! write(*,*)'lecture w ok',w 666 618 667 #ifdef NC_DOUBLE 668 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(13),du) 669 #else 670 ierr = NF_GET_VAR_REAL(nid,var3didin(13),du) 671 #endif 619 ierr = nf90_get_var(nid,var3didin(13),du) 672 620 if(ierr/=NF_NOERR) then 673 621 write(*,*) NF_STRERROR(ierr) … … 676 624 ! write(*,*)'lecture du ok',du 677 625 678 #ifdef NC_DOUBLE 679 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(14),hu) 680 #else 681 ierr = NF_GET_VAR_REAL(nid,var3didin(14),hu) 682 #endif 626 ierr = nf90_get_var(nid,var3didin(14),hu) 683 627 if(ierr/=NF_NOERR) then 684 628 write(*,*) NF_STRERROR(ierr) … … 687 631 ! write(*,*)'lecture hu ok',hu 688 632 689 #ifdef NC_DOUBLE 690 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(15),vu) 691 #else 692 ierr = NF_GET_VAR_REAL(nid,var3didin(15),vu) 693 #endif 633 ierr = nf90_get_var(nid,var3didin(15),vu) 694 634 if(ierr/=NF_NOERR) then 695 635 write(*,*) NF_STRERROR(ierr) … … 698 638 ! write(*,*)'lecture vu ok',vu 699 639 700 #ifdef NC_DOUBLE 701 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(16),dv) 702 #else 703 ierr = NF_GET_VAR_REAL(nid,var3didin(16),dv) 704 #endif 640 ierr = nf90_get_var(nid,var3didin(16),dv) 705 641 if(ierr/=NF_NOERR) then 706 642 write(*,*) NF_STRERROR(ierr) … … 709 645 ! write(*,*)'lecture dv ok',dv 710 646 711 #ifdef NC_DOUBLE 712 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(17),hv) 713 #else 714 ierr = NF_GET_VAR_REAL(nid,var3didin(17),hv) 715 #endif 647 ierr = nf90_get_var(nid,var3didin(17),hv) 716 648 if(ierr/=NF_NOERR) then 717 649 write(*,*) NF_STRERROR(ierr) … … 720 652 ! write(*,*)'lecture hv ok',hv 721 653 722 #ifdef NC_DOUBLE 723 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(18),vv) 724 #else 725 ierr = NF_GET_VAR_REAL(nid,var3didin(18),vv) 726 #endif 654 ierr = nf90_get_var(nid,var3didin(18),vv) 727 655 if(ierr/=NF_NOERR) then 728 656 write(*,*) NF_STRERROR(ierr) … … 731 659 ! write(*,*)'lecture vv ok',vv 732 660 733 #ifdef NC_DOUBLE 734 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(19),dt) 735 #else 736 ierr = NF_GET_VAR_REAL(nid,var3didin(19),dt) 737 #endif 661 ierr = nf90_get_var(nid,var3didin(19),dt) 738 662 if(ierr/=NF_NOERR) then 739 663 write(*,*) NF_STRERROR(ierr) … … 742 666 ! write(*,*)'lecture dt ok',dt 743 667 744 #ifdef NC_DOUBLE 745 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(20),ht) 746 #else 747 ierr = NF_GET_VAR_REAL(nid,var3didin(20),ht) 748 #endif 668 ierr = nf90_get_var(nid,var3didin(20),ht) 749 669 if(ierr/=NF_NOERR) then 750 670 write(*,*) NF_STRERROR(ierr) … … 753 673 ! write(*,*)'lecture ht ok',ht 754 674 755 #ifdef NC_DOUBLE 756 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(21),vt) 757 #else 758 ierr = NF_GET_VAR_REAL(nid,var3didin(21),vt) 759 #endif 675 ierr = nf90_get_var(nid,var3didin(21),vt) 760 676 if(ierr/=NF_NOERR) then 761 677 write(*,*) NF_STRERROR(ierr) … … 764 680 ! write(*,*)'lecture vt ok',vt 765 681 766 #ifdef NC_DOUBLE 767 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(22),dq) 768 #else 769 ierr = NF_GET_VAR_REAL(nid,var3didin(22),dq) 770 #endif 682 ierr = nf90_get_var(nid,var3didin(22),dq) 771 683 if(ierr/=NF_NOERR) then 772 684 write(*,*) NF_STRERROR(ierr) … … 775 687 ! write(*,*)'lecture dq ok',dq 776 688 777 #ifdef NC_DOUBLE 778 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(23),hq) 779 #else 780 ierr = NF_GET_VAR_REAL(nid,var3didin(23),hq) 781 #endif 689 ierr = nf90_get_var(nid,var3didin(23),hq) 782 690 if(ierr/=NF_NOERR) then 783 691 write(*,*) NF_STRERROR(ierr) … … 786 694 ! write(*,*)'lecture hq ok',hq 787 695 788 #ifdef NC_DOUBLE 789 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(24),vq) 790 #else 791 ierr = NF_GET_VAR_REAL(nid,var3didin(24),vq) 792 #endif 696 ierr = nf90_get_var(nid,var3didin(24),vq) 793 697 if(ierr/=NF_NOERR) then 794 698 write(*,*) NF_STRERROR(ierr) … … 797 701 ! write(*,*)'lecture vq ok',vq 798 702 799 #ifdef NC_DOUBLE 800 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(25),dth) 801 #else 802 ierr = NF_GET_VAR_REAL(nid,var3didin(25),dth) 803 #endif 703 ierr = nf90_get_var(nid,var3didin(25),dth) 804 704 if(ierr/=NF_NOERR) then 805 705 write(*,*) NF_STRERROR(ierr) … … 808 708 ! write(*,*)'lecture dth ok',dth 809 709 810 #ifdef NC_DOUBLE 811 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(26),hth) 812 #else 813 ierr = NF_GET_VAR_REAL(nid,var3didin(26),hth) 814 #endif 710 ierr = nf90_get_var(nid,var3didin(26),hth) 815 711 if(ierr/=NF_NOERR) then 816 712 write(*,*) NF_STRERROR(ierr) … … 819 715 ! write(*,*)'lecture hth ok',hth 820 716 821 #ifdef NC_DOUBLE 822 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(27),vth) 823 #else 824 ierr = NF_GET_VAR_REAL(nid,var3didin(27),vth) 825 #endif 717 ierr = nf90_get_var(nid,var3didin(27),vth) 826 718 if(ierr/=NF_NOERR) then 827 719 write(*,*) NF_STRERROR(ierr) … … 830 722 ! write(*,*)'lecture vth ok',vth 831 723 832 #ifdef NC_DOUBLE 833 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(28),dr) 834 #else 835 ierr = NF_GET_VAR_REAL(nid,var3didin(28),dr) 836 #endif 724 ierr = nf90_get_var(nid,var3didin(28),dr) 837 725 if(ierr/=NF_NOERR) then 838 726 write(*,*) NF_STRERROR(ierr) … … 841 729 ! write(*,*)'lecture dr ok',dr 842 730 843 #ifdef NC_DOUBLE 844 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(29),hr) 845 #else 846 ierr = NF_GET_VAR_REAL(nid,var3didin(29),hr) 847 #endif 731 ierr = nf90_get_var(nid,var3didin(29),hr) 848 732 if(ierr/=NF_NOERR) then 849 733 write(*,*) NF_STRERROR(ierr) … … 852 736 ! write(*,*)'lecture hr ok',hr 853 737 854 #ifdef NC_DOUBLE 855 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(30),vr) 856 #else 857 ierr = NF_GET_VAR_REAL(nid,var3didin(30),vr) 858 #endif 738 ierr = nf90_get_var(nid,var3didin(30),vr) 859 739 if(ierr/=NF_NOERR) then 860 740 write(*,*) NF_STRERROR(ierr) … … 863 743 ! write(*,*)'lecture vr ok',vr 864 744 865 #ifdef NC_DOUBLE 866 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(31),dtrad) 867 #else 868 ierr = NF_GET_VAR_REAL(nid,var3didin(31),dtrad) 869 #endif 745 ierr = nf90_get_var(nid,var3didin(31),dtrad) 870 746 if(ierr/=NF_NOERR) then 871 747 write(*,*) NF_STRERROR(ierr) … … 874 750 ! write(*,*)'lecture dtrad ok',dtrad 875 751 876 #ifdef NC_DOUBLE 877 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(32),sens) 878 #else 879 ierr = NF_GET_VAR_REAL(nid,var3didin(32),sens) 880 #endif 752 ierr = nf90_get_var(nid,var3didin(32),sens) 881 753 if(ierr/=NF_NOERR) then 882 754 write(*,*) NF_STRERROR(ierr) … … 885 757 ! write(*,*)'lecture sens ok',sens 886 758 887 #ifdef NC_DOUBLE 888 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(33),flat) 889 #else 890 ierr = NF_GET_VAR_REAL(nid,var3didin(33),flat) 891 #endif 759 ierr = nf90_get_var(nid,var3didin(33),flat) 892 760 if(ierr/=NF_NOERR) then 893 761 write(*,*) NF_STRERROR(ierr) … … 896 764 ! write(*,*)'lecture flat ok',flat 897 765 898 #ifdef NC_DOUBLE 899 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(34),ts) 900 #else 901 ierr = NF_GET_VAR_REAL(nid,var3didin(34),ts) 902 #endif 766 ierr = nf90_get_var(nid,var3didin(34),ts) 903 767 if(ierr/=NF_NOERR) then 904 768 write(*,*) NF_STRERROR(ierr) … … 907 771 ! write(*,*)'lecture ts ok',ts 908 772 909 #ifdef NC_DOUBLE 910 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(35),ustar) 911 #else 912 ierr = NF_GET_VAR_REAL(nid,var3didin(35),ustar) 913 #endif 773 ierr = nf90_get_var(nid,var3didin(35),ustar) 914 774 if(ierr/=NF_NOERR) then 915 775 write(*,*) NF_STRERROR(ierr) … … 918 778 ! write(*,*)'lecture ustar ok',ustar 919 779 920 #ifdef NC_DOUBLE 921 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(36),uw) 922 #else 923 ierr = NF_GET_VAR_REAL(nid,var3didin(36),uw) 924 #endif 780 ierr = nf90_get_var(nid,var3didin(36),uw) 925 781 if(ierr/=NF_NOERR) then 926 782 write(*,*) NF_STRERROR(ierr) … … 929 785 ! write(*,*)'lecture uw ok',uw 930 786 931 #ifdef NC_DOUBLE 932 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(37),vw) 933 #else 934 ierr = NF_GET_VAR_REAL(nid,var3didin(37),vw) 935 #endif 787 ierr = nf90_get_var(nid,var3didin(37),vw) 936 788 if(ierr/=NF_NOERR) then 937 789 write(*,*) NF_STRERROR(ierr) … … 940 792 ! write(*,*)'lecture vw ok',vw 941 793 942 #ifdef NC_DOUBLE 943 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(38),q1) 944 #else 945 ierr = NF_GET_VAR_REAL(nid,var3didin(38),q1) 946 #endif 794 ierr = nf90_get_var(nid,var3didin(38),q1) 947 795 if(ierr/=NF_NOERR) then 948 796 write(*,*) NF_STRERROR(ierr) … … 951 799 ! write(*,*)'lecture q1 ok',q1 952 800 953 #ifdef NC_DOUBLE 954 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(39),q2) 955 #else 956 ierr = NF_GET_VAR_REAL(nid,var3didin(39),q2) 957 #endif 801 ierr = nf90_get_var(nid,var3didin(39),q2) 958 802 if(ierr/=NF_NOERR) then 959 803 write(*,*) NF_STRERROR(ierr) … … 1081 925 1082 926 it_cas1=INT(timeit/pdt_cas)+1 1083 IF (it_cas1 .EQ.nt_cas) THEN927 IF (it_cas1 == nt_cas) THEN 1084 928 it_cas2=it_cas1 1085 929 ELSE … … 1093 937 print *,'time_cas2=',time_cas2 1094 938 1095 if (it_cas1 .gt.nt_cas) then939 if (it_cas1 > nt_cas) then 1096 940 write(*,*) 'PB-stop: day, day_ju_ini_cas,it_cas1, it_cas2, timeit: ' & 1097 941 & ,day,day_ju_ini_cas,it_cas1,it_cas2,timeit … … 1100 944 1101 945 ! time interpolation: 1102 IF (it_cas1 .EQ.it_cas2) THEN946 IF (it_cas1 == it_cas2) THEN 1103 947 frac=0. 1104 948 ELSE -
LMDZ6/trunk/libf/phylmd/interfoce_lim.F90
r3102 r5073 10 10 USE mod_phys_lmdz_para 11 11 USE indice_sol_mod 12 USE lmdz_netcdf 12 13 13 14 IMPLICIT NONE 14 15 INCLUDE "netcdf.inc"16 15 17 16 ! Cette routine sert d'interface entre le modele atmospherique et un fichier … … 116 115 fich = TRIM(fich) 117 116 ierr = NF_OPEN (fich, NF_NOWRITE,nid) 118 IF (ierr .NE.NF_NOERR) THEN117 IF (ierr/=NF_NOERR) THEN 119 118 abort_message = 'Pb d''ouverture du fichier de conditions aux limites' 120 119 CALL abort_physic(modname,abort_message,1) … … 137 136 CALL abort_physic(modname,abort_message,1) 138 137 ENDIF 139 #ifdef NC_DOUBLE 140 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais,pct_tmp(1,is_oce)) 141 #else 142 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais,pct_tmp(1,is_oce)) 143 #endif 138 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_oce),start,epais) 144 139 IF (ierr /= NF_NOERR) THEN 145 140 abort_message = 'Lecture echouee pour <FOCE>' … … 154 149 CALL abort_physic(modname,abort_message,1) 155 150 ENDIF 156 #ifdef NC_DOUBLE 157 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais,pct_tmp(1,is_sic)) 158 #else 159 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais,pct_tmp(1,is_sic)) 160 #endif 151 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_sic),start,epais) 161 152 IF (ierr /= NF_NOERR) THEN 162 153 abort_message = 'Lecture echouee pour <FSIC>' … … 171 162 CALL abort_physic(modname,abort_message,1) 172 163 ENDIF 173 #ifdef NC_DOUBLE 174 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais,pct_tmp(1,is_ter)) 175 #else 176 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais,pct_tmp(1,is_ter)) 177 #endif 164 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_ter),start,epais) 178 165 IF (ierr /= NF_NOERR) THEN 179 166 abort_message = 'Lecture echouee pour <FTER>' … … 188 175 CALL abort_physic(modname,abort_message,1) 189 176 ENDIF 190 #ifdef NC_DOUBLE 191 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais,pct_tmp(1,is_lic)) 192 #else 193 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais,pct_tmp(1,is_lic)) 194 #endif 177 ierr = nf90_get_var(nid,nvarid,pct_tmp(:,is_lic),start,epais) 195 178 IF (ierr /= NF_NOERR) THEN 196 179 abort_message = 'Lecture echouee pour <FLIC>' … … 205 188 CALL abort_physic(modname,abort_message,1) 206 189 ENDIF 207 #ifdef NC_DOUBLE 208 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais, nat_lu) 209 #else 210 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais, nat_lu) 211 #endif 190 ierr = nf90_get_var(nid,nvarid,nat_lu,start,epais) 212 191 IF (ierr /= NF_NOERR) THEN 213 192 abort_message = 'Lecture echouee pour <NAT>' … … 239 218 CALL abort_physic(modname,abort_message,1) 240 219 ENDIF 241 #ifdef NC_DOUBLE 242 ierr = NF_GET_VARA_DOUBLE(nid,nvarid,start,epais, sst_lu) 243 #else 244 ierr = NF_GET_VARA_REAL(nid,nvarid,start,epais, sst_lu) 245 #endif 220 ierr = nf90_get_var(nid,nvarid,sst_lu,start,epais) 246 221 IF (ierr /= NF_NOERR) THEN 247 222 abort_message = 'Lecture echouee pour <SST>' -
LMDZ6/trunk/libf/phylmd/iostart.F90
r3508 r5073 1 1 MODULE iostart 2 2 3 3 PRIVATE 4 4 INTEGER,SAVE :: nid_start … … 30 30 31 31 SUBROUTINE Open_startphy(filename) 32 USE netcdf32 USE lmdz_netcdf 33 33 USE mod_phys_lmdz_para 34 34 IMPLICIT NONE … … 38 38 IF (is_mpi_root .AND. is_omp_root) THEN 39 39 ierr = NF90_OPEN (filename, NF90_NOWRITE,nid_start) 40 IF (ierr .NE.NF90_NOERR) THEN40 IF (ierr/=NF90_NOERR) THEN 41 41 write(6,*)' Pb d''ouverture du fichier '//filename 42 42 write(6,*)' ierr = ', ierr … … 48 48 49 49 SUBROUTINE Close_startphy 50 USE netcdf50 USE lmdz_netcdf 51 51 USE mod_phys_lmdz_para 52 52 IMPLICIT NONE … … 61 61 62 62 FUNCTION Inquire_Field(Field_name) 63 USE netcdf63 USE lmdz_netcdf 64 64 USE mod_phys_lmdz_para 65 65 IMPLICIT NONE … … 115 115 116 116 SUBROUTINE Get_field_rgen(field_name,field,field_size,found) 117 USE netcdf117 USE lmdz_netcdf 118 118 USE dimphy 119 119 USE geometry_mod … … 251 251 252 252 SUBROUTINE Get_var_rgen(var_name,var,var_size,found) 253 USE netcdf253 USE lmdz_netcdf 254 254 USE dimphy 255 255 USE mod_grid_phy_lmdz … … 301 301 302 302 SUBROUTINE open_restartphy(filename) 303 USE netcdf303 USE lmdz_netcdf 304 304 USE mod_phys_lmdz_para, ONLY: is_master 305 305 USE mod_grid_phy_lmdz, ONLY: klon_glo … … 332 332 333 333 SUBROUTINE enddef_restartphy 334 USE netcdf334 USE lmdz_netcdf 335 335 USE mod_phys_lmdz_para 336 336 IMPLICIT NONE … … 342 342 343 343 SUBROUTINE close_restartphy 344 USE netcdf344 USE lmdz_netcdf 345 345 USE mod_phys_lmdz_para 346 346 IMPLICIT NONE … … 385 385 386 386 SUBROUTINE put_field_rgen(pass, field_name,title,field,field_size) 387 USE netcdf387 USE lmdz_netcdf 388 388 USE dimphy 389 389 USE geometry_mod … … 424 424 425 425 ! ierr = NF90_REDEF (nid_restart) 426 #ifdef NC_DOUBLE 427 ierr = NF90_DEF_VAR (nid_restart, field_name, NF90_DOUBLE,(/ idim /),nvarid) 428 #else 429 ierr = NF90_DEF_VAR (nid_restart, field_name, NF90_FLOAT,(/ idim /),nvarid) 430 #endif 426 ierr = NF90_DEF_VAR (nid_restart, field_name, NF90_FORMAT,(/ idim /),nvarid) 431 427 IF (LEN_TRIM(title) > 0) ierr = NF90_PUT_ATT (nid_restart,nvarid,"title", title) 432 428 ! ierr = NF90_ENDDEF(nid_restart) … … 512 508 513 509 SUBROUTINE put_var_rgen(pass, var_name,title,var,var_size) 514 USE netcdf510 USE lmdz_netcdf 515 511 USE dimphy 516 512 USE mod_phys_lmdz_para … … 537 533 ! ierr = NF90_REDEF (nid_restart) 538 534 539 #ifdef NC_DOUBLE 540 ierr = NF90_DEF_VAR (nid_restart, var_name, NF90_DOUBLE,(/ idim1 /),nvarid) 541 #else 542 ierr = NF90_DEF_VAR (nid_restart, var_name, NF90_FLOAT,(/ idim1 /),nvarid) 543 #endif 535 ierr = NF90_DEF_VAR (nid_restart, var_name, NF90_FORMAT,(/ idim1 /),nvarid) 544 536 IF (LEN_TRIM(title)>0) ierr = NF90_PUT_ATT (nid_restart,nvarid,"title", title) 545 537 ! ierr = NF90_ENDDEF(nid_restart) -
LMDZ6/trunk/libf/phylmd/phyaqua_mod.F90
r4619 r5073 133 133 !END IF 134 134 135 if (year_len .ne.360) then135 if (year_len/=360) then 136 136 write (*,*) year_len 137 137 call abort_physic("iniaqua", 'iniaqua: 360 day calendar is required !', 1) … … 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 572 use lmdz_netcdf, ONLY: nf90_def_var, nf90_put_var, nf90_get_var, nf_strerror, nf_close, & 573 nf_enddef, nf_put_att_text, nf_unlimited, nf_noerr, nf_global, nf_clobber, & 574 nf_64bit_offset, nf90_format, nf_def_dim, nf_create 575 575 IMPLICIT NONE 576 include "netcdf.inc"577 576 578 577 INTEGER, INTENT (IN) :: klon … … 616 615 dims(2) = ntim 617 616 618 #ifdef NC_DOUBLE 619 ierr = nf90_def_var(nid, 'TEMPS', nf90_double, [ntim], id_tim) 620 #else 621 ierr = nf90_def_var(nid, 'TEMPS', nf90_float, [ntim], id_tim) 622 #endif 617 ierr = nf90_def_var(nid, 'TEMPS', NF90_FORMAT, [ntim], id_tim) 623 618 ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee') 624 619 625 #ifdef NC_DOUBLE 626 ierr = nf90_def_var(nid, 'NAT', nf90_double, dims, id_nat) 627 #else 628 ierr = nf90_def_var(nid, 'NAT', nf90_float, dims, id_nat) 629 #endif 620 ierr = nf90_def_var(nid, 'NAT', NF90_FORMAT, dims, id_nat) 630 621 ierr = nf_put_att_text(nid, id_nat, 'title', 23, & 631 622 'Nature du sol (0,1,2,3)') 632 623 633 #ifdef NC_DOUBLE 634 ierr = nf90_def_var(nid, 'SST', nf90_double, dims, id_sst) 635 #else 636 ierr = nf90_def_var(nid, 'SST', nf90_float, dims, id_sst) 637 #endif 624 ierr = nf90_def_var(nid, 'SST', NF90_FORMAT, dims, id_sst) 638 625 ierr = nf_put_att_text(nid, id_sst, 'title', 35, & 639 626 'Temperature superficielle de la mer') 640 627 641 #ifdef NC_DOUBLE 642 ierr = nf90_def_var(nid, 'BILS', nf90_double, dims, id_bils) 643 #else 644 ierr = nf90_def_var(nid, 'BILS', nf90_float, dims, id_bils) 645 #endif 628 ierr = nf90_def_var(nid, 'BILS', NF90_FORMAT, dims, id_bils) 646 629 ierr = nf_put_att_text(nid, id_bils, 'title', 32, & 647 630 'Reference flux de chaleur au sol') 648 631 649 #ifdef NC_DOUBLE 650 ierr = nf90_def_var(nid, 'ALB', nf90_double, dims, id_alb) 651 #else 652 ierr = nf90_def_var(nid, 'ALB', nf90_float, dims, id_alb) 653 #endif 632 ierr = nf90_def_var(nid, 'ALB', NF90_FORMAT, dims, id_alb) 654 633 ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface') 655 634 656 #ifdef NC_DOUBLE 657 ierr = nf90_def_var(nid, 'RUG', nf90_double, dims, id_rug) 658 #else 659 ierr = nf90_def_var(nid, 'RUG', nf90_float, dims, id_rug) 660 #endif 635 ierr = nf90_def_var(nid, 'RUG', NF90_FORMAT, dims, id_rug) 661 636 ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite') 662 637 663 #ifdef NC_DOUBLE 664 ierr = nf90_def_var(nid, 'FTER', nf90_double, dims, id_fter) 665 #else 666 ierr = nf90_def_var(nid, 'FTER', nf90_float, dims, id_fter) 667 #endif 638 ierr = nf90_def_var(nid, 'FTER', NF90_FORMAT, dims, id_fter) 668 639 ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land') 669 #ifdef NC_DOUBLE 670 ierr = nf90_def_var(nid, 'FOCE', nf90_double, dims, id_foce) 671 #else 672 ierr = nf90_def_var(nid, 'FOCE', nf90_float, dims, id_foce) 673 #endif 640 ierr = nf90_def_var(nid, 'FOCE', NF90_FORMAT, dims, id_foce) 674 641 ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean') 675 #ifdef NC_DOUBLE 676 ierr = nf90_def_var(nid, 'FSIC', nf90_double, dims, id_fsic) 677 #else 678 ierr = nf90_def_var(nid, 'FSIC', nf90_float, dims, id_fsic) 679 #endif 642 ierr = nf90_def_var(nid, 'FSIC', NF90_FORMAT, dims, id_fsic) 680 643 ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice') 681 #ifdef NC_DOUBLE 682 ierr = nf90_def_var(nid, 'FLIC', nf90_double, dims, id_flic) 683 #else 684 ierr = nf90_def_var(nid, 'FLIC', nf90_float, dims, id_flic) 685 #endif 644 ierr = nf90_def_var(nid, 'FLIC', NF90_FORMAT, dims, id_flic) 686 645 ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice') 687 646 … … 695 654 ! write the 'times' 696 655 DO k = 1, year_len 697 #ifdef NC_DOUBLE 698 ierr = nf_put_var1_double(nid, id_tim, k, dble(k)) 699 #else 700 ierr = nf_put_var1_real(nid, id_tim, k, float(k)) 701 #endif 656 ierr = nf90_put_var(nid, id_tim, k, [k]) 702 657 IF (ierr/=nf_noerr) THEN 703 658 WRITE (*, *) 'writelim error with temps(k),k=', k … … 712 667 CALL gather(phy_nat, phy_glo) 713 668 IF (is_master) THEN 714 #ifdef NC_DOUBLE 715 ierr = nf_put_var_double(nid, id_nat, phy_glo) 716 #else 717 ierr = nf_put_var_real(nid, id_nat, phy_glo) 718 #endif 669 ierr = nf90_put_var(nid, id_nat, phy_glo) 719 670 IF (ierr/=nf_noerr) THEN 720 671 WRITE (*, *) 'writelim error with phy_nat' … … 725 676 CALL gather(phy_sst, phy_glo) 726 677 IF (is_master) THEN 727 #ifdef NC_DOUBLE 728 ierr = nf_put_var_double(nid, id_sst, phy_glo) 729 #else 730 ierr = nf_put_var_real(nid, id_sst, phy_glo) 731 #endif 678 ierr = nf90_put_var(nid, id_sst, phy_glo) 732 679 IF (ierr/=nf_noerr) THEN 733 680 WRITE (*, *) 'writelim error with phy_sst' … … 738 685 CALL gather(phy_bil, phy_glo) 739 686 IF (is_master) THEN 740 #ifdef NC_DOUBLE 741 ierr = nf_put_var_double(nid, id_bils, phy_glo) 742 #else 743 ierr = nf_put_var_real(nid, id_bils, phy_glo) 744 #endif 687 ierr = nf90_put_var(nid, id_bils, phy_glo) 745 688 IF (ierr/=nf_noerr) THEN 746 689 WRITE (*, *) 'writelim error with phy_bil' … … 751 694 CALL gather(phy_alb, phy_glo) 752 695 IF (is_master) THEN 753 #ifdef NC_DOUBLE 754 ierr = nf_put_var_double(nid, id_alb, phy_glo) 755 #else 756 ierr = nf_put_var_real(nid, id_alb, phy_glo) 757 #endif 696 ierr = nf90_put_var(nid, id_alb, phy_glo) 758 697 IF (ierr/=nf_noerr) THEN 759 698 WRITE (*, *) 'writelim error with phy_alb' … … 764 703 CALL gather(phy_rug, phy_glo) 765 704 IF (is_master) THEN 766 #ifdef NC_DOUBLE 767 ierr = nf_put_var_double(nid, id_rug, phy_glo) 768 #else 769 ierr = nf_put_var_real(nid, id_rug, phy_glo) 770 #endif 705 ierr = nf90_put_var(nid, id_rug, phy_glo) 771 706 IF (ierr/=nf_noerr) THEN 772 707 WRITE (*, *) 'writelim error with phy_rug' … … 777 712 CALL gather(phy_fter, phy_glo) 778 713 IF (is_master) THEN 779 #ifdef NC_DOUBLE 780 ierr = nf_put_var_double(nid, id_fter, phy_glo) 781 #else 782 ierr = nf_put_var_real(nid, id_fter, phy_glo) 783 #endif 714 ierr = nf90_put_var(nid, id_fter, phy_glo) 784 715 IF (ierr/=nf_noerr) THEN 785 716 WRITE (*, *) 'writelim error with phy_fter' … … 790 721 CALL gather(phy_foce, phy_glo) 791 722 IF (is_master) THEN 792 #ifdef NC_DOUBLE 793 ierr = nf_put_var_double(nid, id_foce, phy_glo) 794 #else 795 ierr = nf_put_var_real(nid, id_foce, phy_glo) 796 #endif 723 ierr = nf90_put_var(nid, id_foce, phy_glo) 797 724 IF (ierr/=nf_noerr) THEN 798 725 WRITE (*, *) 'writelim error with phy_foce' … … 803 730 CALL gather(phy_fsic, phy_glo) 804 731 IF (is_master) THEN 805 #ifdef NC_DOUBLE 806 ierr = nf_put_var_double(nid, id_fsic, phy_glo) 807 #else 808 ierr = nf_put_var_real(nid, id_fsic, phy_glo) 809 #endif 732 ierr = nf90_put_var(nid, id_fsic, phy_glo) 810 733 IF (ierr/=nf_noerr) THEN 811 734 WRITE (*, *) 'writelim error with phy_fsic' … … 816 739 CALL gather(phy_flic, phy_glo) 817 740 IF (is_master) THEN 818 #ifdef NC_DOUBLE 819 ierr = nf_put_var_double(nid, id_flic, phy_glo) 820 #else 821 ierr = nf_put_var_real(nid, id_flic, phy_glo) 822 #endif 741 ierr = nf90_put_var(nid, id_flic, phy_glo) 823 742 IF (ierr/=nf_noerr) THEN 824 743 WRITE (*, *) 'writelim error with phy_flic' … … 1020 939 END IF 1021 940 1022 if (type_profil .EQ.20) then941 if (type_profil==20) then 1023 942 print*,'Profile SST 20' 1024 943 ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K … … 1029 948 endif 1030 949 1031 if (type_profil .EQ.21) then950 if (type_profil==21) then 1032 951 print*,'Profile SST 21' 1033 952 ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K -
LMDZ6/trunk/libf/phylmd/read_pstoke0.F90
r2345 r5073 270 270 ! **** Geopotentiel au sol *************************************** 271 271 ! phis 272 #ifdef NC_DOUBLE 273 status = nf_get_vara_double(ncidp, varidps, start, count, phisfi2) 274 #else 275 status = nf_get_vara_real(ncidp, varidps, start, count, phisfi2) 276 #endif 272 status = nf90_get_var(ncidp, varidps, phisfi2, start, count) 277 273 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, phisfi2, phisfi) 278 274 279 275 ! **** Aires des mails aux sol ************************************ 280 276 ! aire 281 #ifdef NC_DOUBLE 282 status = nf_get_vara_double(ncidp, varidai, start, count, airefi2) 283 #else 284 status = nf_get_vara_real(ncidp, varidai, start, count, airefi2) 285 #endif 277 status = nf90_get_var(ncidp, varidai, airefi2, start, count) 286 278 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, airefi2, airefi) 287 279 ELSE … … 310 302 311 303 ! abder t 312 #ifdef NC_DOUBLE 313 status = nf_get_vara_double(ncidp, varidt, start, count, t2) 314 #else 315 status = nf_get_vara_real(ncidp, varidt, start, count, t2) 316 #endif 304 status = nf90_get_var(ncidp, varidt, t2, start, count) 317 305 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, t2, t) 318 306 … … 320 308 ! ******************************************** 321 309 ! mfu 322 #ifdef NC_DOUBLE 323 status = nf_get_vara_double(ncidp, varidmfu, start, count, mfu2) 324 #else 325 status = nf_get_vara_real(ncidp, varidmfu, start, count, mfu2) 326 #endif 310 status = nf90_get_var(ncidp, varidmfu, mfu2, start, count) 327 311 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, mfu2, mfu) 328 312 329 313 ! mfd 330 #ifdef NC_DOUBLE 331 status = nf_get_vara_double(ncidp, varidmfd, start, count, mfd2) 332 #else 333 status = nf_get_vara_real(ncidp, varidmfd, start, count, mfd2) 334 #endif 314 status = nf90_get_var(ncidp, varidmfd, mfd2, start, count) 335 315 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, mfd2, mfd) 336 316 337 317 ! en_u 338 #ifdef NC_DOUBLE 339 status = nf_get_vara_double(ncidp, varidenu, start, count, en_u2) 340 #else 341 status = nf_get_vara_real(ncidp, varidenu, start, count, en_u2) 342 #endif 318 status = nf90_get_var(ncidp, varidenu, en_u2, start, count) 343 319 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_u2, en_u) 344 320 345 321 ! de_u 346 #ifdef NC_DOUBLE 347 status = nf_get_vara_double(ncidp, variddeu, start, count, de_u2) 348 #else 349 status = nf_get_vara_real(ncidp, variddeu, start, count, de_u2) 350 #endif 322 status = nf90_get_var(ncidp, variddeu, de_u2, start, count) 351 323 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, de_u2, de_u) 352 324 353 325 ! en_d 354 #ifdef NC_DOUBLE 355 status = nf_get_vara_double(ncidp, varidend, start, count, en_d2) 356 #else 357 status = nf_get_vara_real(ncidp, varidend, start, count, en_d2) 358 #endif 326 status = nf90_get_var(ncidp, varidend, en_d2, start, count) 359 327 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_d2, en_d) 360 328 361 329 ! de_d 362 #ifdef NC_DOUBLE 363 status = nf_get_vara_double(ncidp, varidded, start, count, de_d2) 364 #else 365 status = nf_get_vara_real(ncidp, varidded, start, count, de_d2) 366 #endif 330 status = nf90_get_var(ncidp, varidded, de_d2, start, count) 367 331 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, de_d2, de_d) 368 332 … … 371 335 ! coefh 372 336 PRINT *, 'LECTURE de coefh a irec =', irec 373 #ifdef NC_DOUBLE 374 status = nf_get_vara_double(ncidp, varidch, start, count, coefh2) 375 #else 376 status = nf_get_vara_real(ncidp, varidch, start, count, coefh2) 377 #endif 337 status = nf90_get_var(ncidp, varidch, coefh2, start, count) 378 338 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, coefh2, coefh) 379 339 ! call dump2d(iip1,jjp1,coefh2(1,2),'COEFH2READ ') … … 384 344 ! Thermiques 385 345 PRINT *, 'LECTURE de fm_therm a irec =', irec 386 #ifdef NC_DOUBLE 387 status = nf_get_vara_double(ncidp, varidfmth, start, count, fm_therm2) 388 #else 389 status = nf_get_vara_real(ncidp, varidfmth, start, count, fm_therm2) 390 #endif 346 status = nf90_get_var(ncidp, varidfmth, fm_therm2, start, count) 391 347 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, fm_therm2, fm_therm) 392 348 PRINT *, 'LECTURE de en_therm a irec =', irec 393 #ifdef NC_DOUBLE 394 status = nf_get_vara_double(ncidp, varidenth, start, count, en_therm2) 395 #else 396 status = nf_get_vara_real(ncidp, varidenth, start, count, en_therm2) 397 #endif 349 status = nf90_get_var(ncidp, varidenth, en_therm2, start, count) 398 350 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, en_therm2, en_therm) 399 351 … … 401 353 ! ******************************************* 402 354 ! frac_impa 403 #ifdef NC_DOUBLE 404 status = nf_get_vara_double(ncidp, varidfi, start, count, frac_impa2) 405 #else 406 status = nf_get_vara_real(ncidp, varidfi, start, count, frac_impa2) 407 #endif 355 status = nf90_get_var(ncidp, varidfi, frac_impa2, start, count) 408 356 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, frac_impa2, frac_impa) 409 357 410 358 ! frac_nucl 411 359 412 #ifdef NC_DOUBLE 413 status = nf_get_vara_double(ncidp, varidfn, start, count, frac_nucl2) 414 #else 415 status = nf_get_vara_real(ncidp, varidfn, start, count, frac_nucl2) 416 #endif 360 status = nf90_get_var(ncidp, varidfn, frac_nucl2, start, count) 417 361 CALL gr_ecrit_fi(kev, kon, nbp_lon, nbp_lat, frac_nucl2, frac_nucl) 418 362 … … 426 370 ! pyu1 427 371 PRINT *, 'LECTURE de yu1 a irec =', irec 428 #ifdef NC_DOUBLE 429 status = nf_get_vara_double(ncidp, varidyu1, start, count, pyu12) 430 #else 431 status = nf_get_vara_real(ncidp, varidyu1, start, count, pyu12) 432 #endif 372 status = nf90_get_var(ncidp, varidyu1, pyu12, start, count) 433 373 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, pyu12, pyu1) 434 374 435 375 ! pyv1 436 376 PRINT *, 'LECTURE de yv1 a irec =', irec 437 #ifdef NC_DOUBLE 438 status = nf_get_vara_double(ncidp, varidyv1, start, count, pyv12) 439 #else 440 status = nf_get_vara_real(ncidp, varidyv1, start, count, pyv12) 441 #endif 377 status = nf90_get_var(ncidp, varidyv1, pyv12, start, count) 442 378 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, pyv12, pyv1) 443 379 … … 445 381 ! ftsol1 446 382 PRINT *, 'LECTURE de ftsol1 a irec =', irec 447 #ifdef NC_DOUBLE 448 status = nf_get_vara_double(ncidp, varidfts1, start, count, ftsol12) 449 #else 450 status = nf_get_vara_real(ncidp, varidfts1, start, count, ftsol12) 451 #endif 383 status = nf90_get_var(ncidp, varidfts1, ftsol12, start, count) 452 384 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol12, ftsol1) 453 385 454 386 ! ftsol2 455 387 PRINT *, 'LECTURE de ftsol2 a irec =', irec 456 #ifdef NC_DOUBLE 457 status = nf_get_vara_double(ncidp, varidfts2, start, count, ftsol22) 458 #else 459 status = nf_get_vara_real(ncidp, varidfts2, start, count, ftsol22) 460 #endif 388 status = nf90_get_var(ncidp, varidfts2, ftsol22, start, count) 461 389 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol22, ftsol2) 462 390 463 391 ! ftsol3 464 392 PRINT *, 'LECTURE de ftsol3 a irec =', irec 465 #ifdef NC_DOUBLE 466 status = nf_get_vara_double(ncidp, varidfts3, start, count, ftsol32) 467 #else 468 status = nf_get_vara_real(ncidp, varidfts3, start, count, ftsol32) 469 #endif 393 status = nf90_get_var(ncidp, varidfts3, ftsol32, start, count) 470 394 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol32, ftsol3) 471 395 472 396 ! ftsol4 473 #ifdef NC_DOUBLE 474 status = nf_get_vara_double(ncidp, varidfts4, start, count, ftsol42) 475 #else 476 status = nf_get_vara_real(ncidp, varidfts4, start, count, ftsol42) 477 #endif 397 status = nf90_get_var(ncidp, varidfts4, ftsol42, start, count) 478 398 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, ftsol42, ftsol4) 479 399 480 400 ! **** Nature sol ******************************************** 481 401 ! psrf1 482 #ifdef NC_DOUBLE 483 status = nf_get_vara_double(ncidp, varidpsr1, start, count, psrf12) 484 #else 485 status = nf_get_vara_real(ncidp, varidpsr1, start, count, psrf12) 486 #endif 402 status = nf90_get_var(ncidp, varidpsr1, psrf12, start, count) 487 403 ! call dump2d(iip1-1,jjm+1,psrf12,'PSRF1NC') 488 404 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf12, psrf1) 489 405 490 406 ! psrf2 491 #ifdef NC_DOUBLE 492 status = nf_get_vara_double(ncidp, varidpsr2, start, count, psrf22) 493 #else 494 status = nf_get_vara_real(ncidp, varidpsr2, start, count, psrf22) 495 #endif 407 status = nf90_get_var(ncidp, varidpsr2, psrf22, start, count) 496 408 ! call dump2d(iip1-1,jjm+1,psrf22,'PSRF2NC') 497 409 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf22, psrf2) 498 410 499 411 ! psrf3 500 #ifdef NC_DOUBLE 501 status = nf_get_vara_double(ncidp, varidpsr3, start, count, psrf32) 502 #else 503 status = nf_get_vara_real(ncidp, varidpsr3, start, count, psrf32) 504 #endif 412 status = nf90_get_var(ncidp, varidpsr3, psrf32, start, count) 505 413 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf32, psrf3) 506 414 507 415 ! psrf4 508 #ifdef NC_DOUBLE 509 status = nf_get_vara_double(ncidp, varidpsr4, start, count, psrf42) 510 #else 511 status = nf_get_vara_real(ncidp, varidpsr4, start, count, psrf42) 512 #endif 416 status = nf90_get_var(ncidp, varidpsr4, psrf42, start, count) 513 417 CALL gr_ecrit_fi(1, kon, nbp_lon, nbp_lat, psrf42, psrf4) 514 418 -
LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90
r4619 r5073 636 636 dims(2) = ntim 637 637 638 #ifdef NC_DOUBLE 639 ierr = nf_def_var(nid, 'TEMPS', nf_double, 1, ntim, id_tim) 640 #else 641 ierr = nf_def_var(nid, 'TEMPS', nf_float, 1, ntim, id_tim) 642 #endif 638 ierr = nf_def_var(nid, 'TEMPS', NF90_FORMAT, 1, ntim, id_tim) 643 639 ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee') 644 640 645 #ifdef NC_DOUBLE 646 ierr = nf_def_var(nid, 'NAT', nf_double, 2, dims, id_nat) 647 #else 648 ierr = nf_def_var(nid, 'NAT', nf_float, 2, dims, id_nat) 649 #endif 641 ierr = nf_def_var(nid, 'NAT', NF90_FORMAT, 2, dims, id_nat) 650 642 ierr = nf_put_att_text(nid, id_nat, 'title', 23, & 651 643 'Nature du sol (0,1,2,3)') 652 644 653 #ifdef NC_DOUBLE 654 ierr = nf_def_var(nid, 'SST', nf_double, 2, dims, id_sst) 655 #else 656 ierr = nf_def_var(nid, 'SST', nf_float, 2, dims, id_sst) 657 #endif 645 ierr = nf_def_var(nid, 'SST', NF90_FORMAT, 2, dims, id_sst) 658 646 ierr = nf_put_att_text(nid, id_sst, 'title', 35, & 659 647 'Temperature superficielle de la mer') 660 648 661 #ifdef NC_DOUBLE 662 ierr = nf_def_var(nid, 'BILS', nf_double, 2, dims, id_bils) 663 #else 664 ierr = nf_def_var(nid, 'BILS', nf_float, 2, dims, id_bils) 665 #endif 649 ierr = nf_def_var(nid, 'BILS', NF90_FORMAT, 2, dims, id_bils) 666 650 ierr = nf_put_att_text(nid, id_bils, 'title', 32, & 667 651 'Reference flux de chaleur au sol') 668 652 669 #ifdef NC_DOUBLE 670 ierr = nf_def_var(nid, 'ALB', nf_double, 2, dims, id_alb) 671 #else 672 ierr = nf_def_var(nid, 'ALB', nf_float, 2, dims, id_alb) 673 #endif 653 ierr = nf_def_var(nid, 'ALB', NF90_FORMAT, 2, dims, id_alb) 674 654 ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface') 675 655 676 #ifdef NC_DOUBLE 677 ierr = nf_def_var(nid, 'RUG', nf_double, 2, dims, id_rug) 678 #else 679 ierr = nf_def_var(nid, 'RUG', nf_float, 2, dims, id_rug) 680 #endif 656 ierr = nf_def_var(nid, 'RUG', NF90_FORMAT, 2, dims, id_rug) 681 657 ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite') 682 658 683 #ifdef NC_DOUBLE 684 ierr = nf_def_var(nid, 'FTER', nf_double, 2, dims, id_fter) 685 #else 686 ierr = nf_def_var(nid, 'FTER', nf_float, 2, dims, id_fter) 687 #endif 659 ierr = nf_def_var(nid, 'FTER', NF90_FORMAT, 2, dims, id_fter) 688 660 ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land') 689 #ifdef NC_DOUBLE 690 ierr = nf_def_var(nid, 'FOCE', nf_double, 2, dims, id_foce) 691 #else 692 ierr = nf_def_var(nid, 'FOCE', nf_float, 2, dims, id_foce) 693 #endif 661 ierr = nf_def_var(nid, 'FOCE', NF90_FORMAT, 2, dims, id_foce) 694 662 ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean') 695 #ifdef NC_DOUBLE 696 ierr = nf_def_var(nid, 'FSIC', nf_double, 2, dims, id_fsic) 697 #else 698 ierr = nf_def_var(nid, 'FSIC', nf_float, 2, dims, id_fsic) 699 #endif 663 ierr = nf_def_var(nid, 'FSIC', NF90_FORMAT, 2, dims, id_fsic) 700 664 ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice') 701 #ifdef NC_DOUBLE 702 ierr = nf_def_var(nid, 'FLIC', nf_double, 2, dims, id_flic) 703 #else 704 ierr = nf_def_var(nid, 'FLIC', nf_float, 2, dims, id_flic) 705 #endif 665 ierr = nf_def_var(nid, 'FLIC', NF90_FORMAT, 2, dims, id_flic) 706 666 ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice') 707 667 … … 715 675 ! write the 'times' 716 676 DO k = 1, year_len 717 #ifdef NC_DOUBLE 718 ierr = nf_put_var1_double(nid, id_tim, k, dble(k)) 719 #else 720 ierr = nf_put_var1_real(nid, id_tim, k, float(k)) 721 #endif 677 ierr = nf90_put_var(nid, id_tim, k, k) 722 678 IF (ierr/=nf_noerr) THEN 723 679 WRITE (*, *) 'writelim error with temps(k),k=', k … … 732 688 CALL gather(phy_nat, phy_glo) 733 689 IF (is_master) THEN 734 #ifdef NC_DOUBLE 735 ierr = nf_put_var_double(nid, id_nat, phy_glo) 736 #else 737 ierr = nf_put_var_real(nid, id_nat, phy_glo) 738 #endif 690 ierr = nf90_put_var(nid, id_nat, phy_glo) 739 691 IF (ierr/=nf_noerr) THEN 740 692 WRITE (*, *) 'writelim error with phy_nat' … … 745 697 CALL gather(phy_sst, phy_glo) 746 698 IF (is_master) THEN 747 #ifdef NC_DOUBLE 748 ierr = nf_put_var_double(nid, id_sst, phy_glo) 749 #else 750 ierr = nf_put_var_real(nid, id_sst, phy_glo) 751 #endif 699 ierr = nf90_put_var(nid, id_sst, phy_glo) 752 700 IF (ierr/=nf_noerr) THEN 753 701 WRITE (*, *) 'writelim error with phy_sst' … … 758 706 CALL gather(phy_bil, phy_glo) 759 707 IF (is_master) THEN 760 #ifdef NC_DOUBLE 761 ierr = nf_put_var_double(nid, id_bils, phy_glo) 762 #else 763 ierr = nf_put_var_real(nid, id_bils, phy_glo) 764 #endif 708 ierr = nf90_put_var(nid, id_bils, phy_glo) 765 709 IF (ierr/=nf_noerr) THEN 766 710 WRITE (*, *) 'writelim error with phy_bil' … … 771 715 CALL gather(phy_alb, phy_glo) 772 716 IF (is_master) THEN 773 #ifdef NC_DOUBLE 774 ierr = nf_put_var_double(nid, id_alb, phy_glo) 775 #else 776 ierr = nf_put_var_real(nid, id_alb, phy_glo) 777 #endif 717 ierr = nf90_put_var(nid, id_alb, phy_glo) 778 718 IF (ierr/=nf_noerr) THEN 779 719 WRITE (*, *) 'writelim error with phy_alb' … … 784 724 CALL gather(phy_rug, phy_glo) 785 725 IF (is_master) THEN 786 #ifdef NC_DOUBLE 787 ierr = nf_put_var_double(nid, id_rug, phy_glo) 788 #else 789 ierr = nf_put_var_real(nid, id_rug, phy_glo) 790 #endif 726 ierr = nf90_put_var(nid, id_rug, phy_glo) 791 727 IF (ierr/=nf_noerr) THEN 792 728 WRITE (*, *) 'writelim error with phy_rug' … … 797 733 CALL gather(phy_fter, phy_glo) 798 734 IF (is_master) THEN 799 #ifdef NC_DOUBLE 800 ierr = nf_put_var_double(nid, id_fter, phy_glo) 801 #else 802 ierr = nf_put_var_real(nid, id_fter, phy_glo) 803 #endif 735 ierr = nf90_put_var(nid, id_fter, phy_glo) 804 736 IF (ierr/=nf_noerr) THEN 805 737 WRITE (*, *) 'writelim error with phy_fter' … … 810 742 CALL gather(phy_foce, phy_glo) 811 743 IF (is_master) THEN 812 #ifdef NC_DOUBLE 813 ierr = nf_put_var_double(nid, id_foce, phy_glo) 814 #else 815 ierr = nf_put_var_real(nid, id_foce, phy_glo) 816 #endif 744 ierr = nf90_put_var(nid, id_foce, phy_glo) 817 745 IF (ierr/=nf_noerr) THEN 818 746 WRITE (*, *) 'writelim error with phy_foce' … … 823 751 CALL gather(phy_fsic, phy_glo) 824 752 IF (is_master) THEN 825 #ifdef NC_DOUBLE 826 ierr = nf_put_var_double(nid, id_fsic, phy_glo) 827 #else 828 ierr = nf_put_var_real(nid, id_fsic, phy_glo) 829 #endif 753 ierr = nf90_put_var(nid, id_fsic, phy_glo) 830 754 IF (ierr/=nf_noerr) THEN 831 755 WRITE (*, *) 'writelim error with phy_fsic' … … 836 760 CALL gather(phy_flic, phy_glo) 837 761 IF (is_master) THEN 838 #ifdef NC_DOUBLE 839 ierr = nf_put_var_double(nid, id_flic, phy_glo) 840 #else 841 ierr = nf_put_var_real(nid, id_flic, phy_glo) 842 #endif 762 ierr = nf90_put_var(nid, id_flic, phy_glo) 843 763 IF (ierr/=nf_noerr) THEN 844 764 WRITE (*, *) 'writelim error with phy_flic'
Note: See TracChangeset
for help on using the changeset viewer.