Changeset 1984 for LMDZ5/trunk/libf/dyn3d_common
- Timestamp:
- Feb 18, 2014, 10:59:29 AM (11 years ago)
- Location:
- LMDZ5/trunk/libf/dyn3d_common
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90
r1952 r1984 1 1 ! 2 ! $ Header$2 ! $Id: $ 3 3 ! 4 4 ! This subroutine creates the file grilles_gcm.nc containg longitudes and 5 5 ! latitudes in degrees for grid u and v. This subroutine is called from 6 ! ce0l if grilles_gcm_netcdf=TRUE. This subroutine corresponds to the first6 ! ce0l. This subroutine corresponds to the first 7 7 ! part in the program create_fausse_var. 8 8 ! … … 48 48 INTEGER :: area_id 49 49 INTEGER :: mask_id 50 INTEGER :: presnivs_id 50 51 51 52 rad = 6400000 … … 80 81 ! CREATION OUTPUT 81 82 ! ouverture fichier netcdf de sortie out 82 status=NF_CREATE('grilles_gcm.nc',NF_NOCLOBBER,ncid_out) 83 status=NF_CREATE('grilles_gcm.nc',NF_CLOBBER,ncid_out) 84 CALL handle_err(status) 83 85 status=NF_DEF_DIM(ncid_out,'lonu',iim+1,out_lonudim) 86 CALL handle_err(status) 84 87 status=NF_DEF_DIM(ncid_out,'lonv',iim+1,out_lonvdim) 88 CALL handle_err(status) 85 89 status=NF_DEF_DIM(ncid_out,'latu',jjm+1,out_latudim) 90 CALL handle_err(status) 86 91 status=NF_DEF_DIM(ncid_out,'latv',jjm,out_latvdim) 92 CALL handle_err(status) 87 93 88 94 … … 136 142 137 143 status=NF_ENDDEF(ncid_out) 144 write(*,*) "COUCOU 6" 145 CALL handle_err(status) 138 146 ! 5) ----- FERMETURE DES FICHIERS NETCDF------------------ 139 147 ! -------------------------------------------------------- … … 143 151 #ifdef NC_DOUBLE 144 152 status=NF_PUT_VARA_DOUBLE(ncid_out,out_lonuid,1,iim+1,rlonudeg) 153 CALL handle_err(status) 145 154 status=NF_PUT_VARA_DOUBLE(ncid_out,out_lonvid,1,iim+1,rlonvdeg) 155 CALL handle_err(status) 146 156 status=NF_PUT_VARA_DOUBLE(ncid_out,out_latuid,1,jjm+1,rlatudeg) 157 CALL handle_err(status) 147 158 status=NF_PUT_VARA_DOUBLE(ncid_out,out_latvid,1,jjm,rlatvdeg) 159 CALL handle_err(status) 148 160 #else 149 161 status=NF_PUT_VARA_REAL(ncid_out,out_lonuid,1,iim+1,rlonudeg) 162 CALL handle_err(status) 150 163 status=NF_PUT_VARA_REAL(ncid_out,out_lonvid,1,iim+1,rlonvdeg) 164 CALL handle_err(status) 151 165 status=NF_PUT_VARA_REAL(ncid_out,out_latuid,1,jjm+1,rlatudeg) 166 CALL handle_err(status) 152 167 status=NF_PUT_VARA_REAL(ncid_out,out_latvid,1,jjm,rlatvdeg) 168 CALL handle_err(status) 153 169 #endif 154 170 … … 171 187 #ifdef NC_DOUBLE 172 188 status=NF_PUT_VARA_DOUBLE(ncid_out,out_varid,start, count,temp) 189 CALL handle_err(status) 173 190 #else 174 191 status=NF_PUT_VARA_REAL(ncid_out,out_varid,start, count,temp) 192 CALL handle_err(status) 175 193 #endif 176 194 177 195 ! On re-ouvre le fichier pour rajouter 4 nouvelles variables necessaire pour INCA 178 196 ! lev - phis - aire - mask 179 rlevdeg(:) = presnivs 197 ! rlevdeg(:) = presnivs 198 rlevdeg(:) = presnivs(:) 180 199 phis_loc(:,:) = phis(:,:)/g 181 200 182 201 ! niveaux de pression verticaux 183 202 status = NF_REDEF (ncid_out) 203 CALL handle_err(status) 184 204 status=NF_DEF_DIM(ncid_out,'lev',llm,out_levdim) 205 CALL handle_err(status) 206 status=NF_DEF_VAR(ncid_out,'presnivs',NF_FLOAT,1,out_levdim,& 207 presnivs_id) 208 CALL handle_err(status) 185 209 186 210 ! fields … … 196 220 197 221 status=NF_ENDDEF(ncid_out) 222 CALL handle_err(status) 198 223 199 224 ! ecriture des variables 200 225 #ifdef NC_DOUBLE 201 status=NF_PUT_VARA_DOUBLE(ncid_out,out_levid,1,llm,rlevdeg) 226 status=NF_PUT_VARA_DOUBLE(ncid_out,presnivs_id,1,llm,rlevdeg) 227 CALL handle_err(status) 202 228 #else 203 229 status=NF_PUT_VARA_REAL(ncid_out,out_levid,1,llm,rlevdeg) 230 CALL handle_err(status) 204 231 #endif 205 232 … … 214 241 215 242 status = nf_put_vara_double(ncid_out, phis_id,start,count, phis_loc) 243 CALL handle_err(status) 216 244 status = nf_put_vara_double(ncid_out, area_id,start,count, aire) 245 CALL handle_err(status) 217 246 masque_int(:,:) = nINT(masque(:,:)) 218 247 status = nf_put_vara_int(ncid_out, mask_id,start,count,masque_int)
Note: See TracChangeset
for help on using the changeset viewer.