Changeset 5409 for branches/2014/dev_r5134_UKMO4_CF_compliance
- Timestamp:
- 2015-06-12T17:40:01+02:00 (9 years ago)
- Location:
- branches/2014/dev_r5134_UKMO4_CF_compliance/NEMOGCM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r5134_UKMO4_CF_compliance/NEMOGCM/CONFIG/SHARED/domain_def.xml
r5350 r5409 5 5 <!-- My zoom: example of hand defined zoom --> 6 6 <domain id="myzoom" zoom_ibegin="10" zoom_jbegin="10" zoom_ni="5" zoom_nj="5" /> 7 <domain id="1point" zoom_ibegin="10" zoom_jbegin="10" zoom_ni="1" zoom_nj="1" />8 7 <domain id="ptr" zoom_ibegin="0000" zoom_jbegin="1" zoom_ni="1" zoom_nj="0000" /> 9 8 <!-- Eq section --> … … 170 169 </domain_group> 171 170 172 <domain_group id="scalarpoint"> 173 <domain id="scalarpoint" long_name="scalar"/> 174 <!-- 175 <domain id="1point" zoom_ibegin="1" zoom_jbegin="1" zoom_ni="1" zoom_nj="1" /> 176 --> 171 <domain_group id="scalarpoint" long_name="scalar" zoom_ibegin="1" zoom_jbegin="1" zoom_ni="1" zoom_nj="1"> 172 <domain id="1point"/> 173 <domain id="globalscalar" /> 177 174 </domain_group> 178 175 -
branches/2014/dev_r5134_UKMO4_CF_compliance/NEMOGCM/CONFIG/SHARED/field_def.xml
r5350 r5409 451 451 <!-- scalar variables available with key_diaar5 --> 452 452 453 <field_group id="scalar" domain_ref=" 1point" >453 <field_group id="scalar" domain_ref="globalscalar" > 454 454 <field id="voltot" long_name="global total volume" standard_name="sea_water_volume" unit="m3" /> 455 455 <field id="sshtot" long_name="global mean ssh" standard_name="global_average_sea_level_change" unit="m" /> … … 459 459 <field id="temptot" long_name="global mean temperature" standard_name="sea_water_potential_temperature" unit="degC" /> 460 460 <field id="saltot" long_name="global mean salinity" standard_name="sea_water_salinity" unit="1e-3" /> 461 <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait" standard_name="sea_ice_transport_across_line" unit="kg/s" />461 <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait" standard_name="sea_ice_transport_across_line" unit="kg/s" domain_ref="1point" /> 462 462 463 463 <!-- available with ln_diahsb --> … … 480 480 <!-- LIM3 scalar variables --> 481 481 482 <field_group id="SBC_scalar" domain_ref=" 1point" >482 <field_group id="SBC_scalar" domain_ref="globalscalar" > 483 483 <!-- available with ln_limdiaout --> 484 484 <field id="ibgvoltot" long_name="global mean ice volume" unit="km3" /> … … 881 881 </field_group> 882 882 883 <field_group id="PISCES_scalar" domain_ref=" 1point" >883 <field_group id="PISCES_scalar" domain_ref="globalscalar" > 884 884 <field id="pno3tot" long_name="global mean nitrate concentration" unit="mol/m3" /> 885 885 <field id="psiltot" long_name="global mean silicate concentration" unit="mol/m3" /> -
branches/2014/dev_r5134_UKMO4_CF_compliance/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r5406 r5409 127 127 CALL set_grid( "W", glamt, gphit ) 128 128 ! 129 IF( ln_cfmeta ) THEN ! Add cell areas129 IF( ln_cfmeta ) THEN ! Add additional grid metadata 130 130 CALL iom_set_domain_attr("grid_T", area = e12t(nldi:nlei, nldj:nlej)) 131 131 CALL iom_set_domain_attr("grid_U", area = e12u(nldi:nlei, nldj:nlej)) 132 132 CALL iom_set_domain_attr("grid_V", area = e12v(nldi:nlei, nldj:nlej)) 133 133 CALL iom_set_domain_attr("grid_W", area = e12t(nldi:nlei, nldj:nlej)) 134 CALL set_grid_bounds( "T", glamf, gphif, glamt, gphit ) 135 CALL set_grid_bounds( "U", glamv, gphiv, glamu, gphiu ) 136 CALL set_grid_bounds( "V", glamu, gphiu, glamv, gphiv ) 137 CALL set_grid_bounds( "W", glamf, gphif, glamt, gphit ) 134 138 ENDIF 135 139 ENDIF … … 145 149 CALL dom_grid_glo ! Return to parent grid domain 146 150 ! 147 IF( ln_cfmeta ) THEN ! Add cell areas151 IF( ln_cfmeta ) THEN ! Add additional grid metadata 148 152 CALL iom_set_domain_attr("grid_T", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 149 153 CALL iom_set_domain_attr("grid_U", area = e1u_crs(nldi:nlei, nldj:nlej) * e2u_crs(nldi:nlei, nldj:nlej)) 150 154 CALL iom_set_domain_attr("grid_V", area = e1v_crs(nldi:nlei, nldj:nlej) * e2v_crs(nldi:nlei, nldj:nlej)) 151 155 CALL iom_set_domain_attr("grid_W", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 152 ENDIF 153 ENDIF 154 155 IF ( ln_cfmeta ) THEN ! Add horizontal grid bounds 156 CALL set_grid_bounds( "T", cdname ) 157 CALL set_grid_bounds( "U", cdname ) 158 CALL set_grid_bounds( "V", cdname ) 159 CALL set_grid_bounds( "W", cdname ) 156 CALL set_grid_bounds( "T", glamf_crs, gphif_crs, glamt_crs, gphit_crs ) 157 CALL set_grid_bounds( "U", glamv_crs, gphiv_crs, glamu_crs, gphiu_crs ) 158 CALL set_grid_bounds( "V", glamu_crs, gphiu_crs, glamv_crs, gphiv_crs ) 159 CALL set_grid_bounds( "W", glamf_crs, gphif_crs, glamt_crs, gphit_crs ) 160 ENDIF 160 161 ENDIF 161 162 … … 1101 1102 CHARACTER(LEN=*), INTENT(in) :: cdname 1102 1103 REAL(wp) , INTENT(in) :: pfield0d 1103 REAL(wp) , DIMENSION(jpi,jpj) :: zz ! masson1104 1104 #if defined key_iomput 1105 zz(:,:)=pfield0d 1106 CALL xios_send_field(cdname, zz) 1107 !CALL xios_send_field(cdname, (/pfield0d/)) 1105 CALL xios_send_field(cdname, (/pfield0d/)) 1108 1106 #else 1109 1107 IF( .FALSE. ) WRITE(numout,*) cdname, pfield0d ! useless test to avoid compilation warnings … … 1300 1298 1301 1299 1302 SUBROUTINE set_grid_bounds( cdgrd, cdname)1300 SUBROUTINE set_grid_bounds( cdgrd, plon_cnr, plat_cnr, plon_pnt, plat_pnt ) 1303 1301 !!---------------------------------------------------------------------- 1304 1302 !! *** ROUTINE set_grid_bounds *** … … 1308 1306 !!---------------------------------------------------------------------- 1309 1307 CHARACTER(LEN=1) , INTENT(in) :: cdgrd 1310 CHARACTER(LEN=*) , INTENT(in) :: cdname 1308 ! 1309 REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: plon_cnr, plat_cnr ! Lat/lon coordinates of a contiguous vertex of cell (i,j) 1310 REAL(wp), DIMENSION(jpi,jpj), OPTIONAL, INTENT(in) :: plon_pnt, plat_pnt ! Lat/lon coordinates of the point of cell (i,j) 1311 1311 ! 1312 1312 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: z_bnds ! Lat/lon coordinates of the vertices of cell (i,j) 1313 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_cnr ! Lat/lon coordinates of a contiguous vertex of cell (i,j)1314 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_pnt ! Lat/lon coordinates of the point of cell (i,j)1315 1313 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_fld ! Working array to determine where to rotate cells 1316 1314 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_rot ! Lat/lon working array for rotation of cells … … 1320 1318 INTEGER :: ji, jj, jn, ni, nj 1321 1319 1322 ALLOCATE( z_bnds(4,jpi,jpj,2), z_ cnr(jpi,jpj,2), z_pnt(jpi,jpj,2), z_fld(jpi,jpj), z_rot(4,2) )1323 1324 ! Grid information1320 ALLOCATE( z_bnds(4,jpi,jpj,2), z_fld(jpi,jpj), z_rot(4,2) ) 1321 1322 ! Offset of coordinate representing bottom-left corner 1325 1323 SELECT CASE ( TRIM(cdgrd) ) 1326 1324 CASE ('T', 'W') 1327 1325 icnr = -1 ; jcnr = -1 1328 IF( TRIM(cdname) == "nemo_crs" ) THEN1329 z_cnr(:,:,1) = gphif_crs ; z_cnr(:,:,2) = glamf_crs1330 z_pnt(:,:,1) = gphit_crs ; z_pnt(:,:,2) = glamt_crs1331 ELSE1332 z_cnr(:,:,1) = gphif ; z_cnr(:,:,2) = glamf1333 z_pnt(:,:,1) = gphit ; z_pnt(:,:,2) = glamt1334 ENDIF1335 1326 CASE ('U') 1336 1327 icnr = 0 ; jcnr = -1 1337 IF( TRIM(cdname) == "nemo_crs" ) THEN1338 z_cnr(:,:,1) = gphiv_crs ; z_cnr(:,:,2) = glamv_crs1339 z_pnt(:,:,1) = gphiu_crs ; z_pnt(:,:,2) = glamu_crs1340 ELSE1341 z_cnr(:,:,1) = gphiv ; z_cnr(:,:,2) = glamv1342 z_pnt(:,:,1) = gphiu ; z_pnt(:,:,2) = glamu1343 ENDIF1344 1328 CASE ('V') 1345 1329 icnr = -1 ; jcnr = 0 1346 IF( TRIM(cdname) == "nemo_crs" ) THEN1347 z_cnr(:,:,1) = gphiu_crs ; z_cnr(:,:,2) = glamu_crs1348 z_pnt(:,:,1) = gphiv_crs ; z_pnt(:,:,2) = glamv_crs1349 ELSE1350 z_cnr(:,:,1) = gphiu ; z_cnr(:,:,2) = glamu1351 z_pnt(:,:,1) = gphiv ; z_pnt(:,:,2) = glamv1352 ENDIF1353 1330 END SELECT 1354 1331 … … 1361 1338 DO jj = 2, jpjm1 1362 1339 DO ji = 2, jpim1 1363 z_bnds(1,ji,jj,:) = z_cnr(ji+icnr, jj+jcnr ,:) ! Bottom-left 1364 z_bnds(2,ji,jj,:) = z_cnr(ji+icnr+1,jj+jcnr ,:) ! Bottom-right 1365 z_bnds(3,ji,jj,:) = z_cnr(ji+icnr+1,jj+jcnr+1,:) ! Top-right 1366 z_bnds(4,ji,jj,:) = z_cnr(ji+icnr, jj+jcnr+1,:) ! Top-left 1340 z_bnds(1,ji,jj,1) = plat_cnr(ji+icnr, jj+jcnr ) ! Bottom-left 1341 z_bnds(2,ji,jj,1) = plat_cnr(ji+icnr+1,jj+jcnr ) ! Bottom-right 1342 z_bnds(3,ji,jj,1) = plat_cnr(ji+icnr+1,jj+jcnr+1) ! Top-right 1343 z_bnds(4,ji,jj,1) = plat_cnr(ji+icnr, jj+jcnr+1) ! Top-left 1344 z_bnds(1,ji,jj,2) = plon_cnr(ji+icnr, jj+jcnr ) ! Bottom-left 1345 z_bnds(2,ji,jj,2) = plon_cnr(ji+icnr+1,jj+jcnr ) ! Bottom-right 1346 z_bnds(3,ji,jj,2) = plon_cnr(ji+icnr+1,jj+jcnr+1) ! Top-right 1347 z_bnds(4,ji,jj,2) = plon_cnr(ji+icnr, jj+jcnr+1) ! Top-left 1367 1348 END DO 1368 1349 END DO … … 1374 1355 END DO 1375 1356 1376 ! Zero-size cells at closed boundaries 1377 IF( (nbondi == -1 .OR. nbondi == 2) .AND. .NOT. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6) ) THEN 1378 DO jn = 1, 4 ; z_bnds(jn,1,:,:) = z_pnt(1,:,:) ; END DO ! (West or jpni = 1), closed E-W 1379 ENDIF 1380 IF( (nbondi == 1 .OR. nbondi == 2) .AND. .NOT. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6) ) THEN 1381 DO jn = 1, 4 ; z_bnds(jn,nlci,:,:) = z_pnt(nlci,:,:) ; END DO ! (East or jpni = 1), closed E-W 1382 ENDIF 1383 IF( nbondj == -1 .OR. (nbondj == 2 .AND. jperio /= 2) ) THEN 1384 DO jn = 1, 4 ; z_bnds(jn,:,1,:) = z_pnt(:,1,:) ; END DO ! South or (jpnj = 1, not symmetric) 1385 ENDIF 1386 IF( (nbondj == 1 .OR. nbondj == 2) .AND. jperio < 3 ) THEN 1387 DO jn = 1, 4 ; z_bnds(jn,:,nlcj,:) = z_pnt(:,nlcj,:) ; END DO ! (North or jpnj = 1), no north fold 1357 ! Zero-size cells at closed boundaries if cell points provided, 1358 ! otherwise they are closed cells with unrealistic bounds 1359 IF( PRESENT(plon_pnt) .AND. PRESENT(plat_pnt) ) THEN 1360 IF( (nbondi == -1 .OR. nbondi == 2) .AND. .NOT. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6) ) THEN 1361 DO jn = 1, 4 ! (West or jpni = 1), closed E-W 1362 z_bnds(jn,1,:,1) = plat_pnt(1,:) ; z_bnds(jn,1,:,2) = plon_pnt(1,:) 1363 END DO 1364 ENDIF 1365 IF( (nbondi == 1 .OR. nbondi == 2) .AND. .NOT. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6) ) THEN 1366 DO jn = 1, 4 ! (East or jpni = 1), closed E-W 1367 z_bnds(jn,nlci,:,1) = plat_pnt(nlci,:) ; z_bnds(jn,nlci,:,2) = plon_pnt(nlci,:) 1368 END DO 1369 ENDIF 1370 IF( nbondj == -1 .OR. (nbondj == 2 .AND. jperio /= 2) ) THEN 1371 DO jn = 1, 4 ! South or (jpnj = 1, not symmetric) 1372 z_bnds(jn,:,1,1) = plat_pnt(:,1) ; z_bnds(jn,:,1,2) = plon_pnt(:,1) 1373 END DO 1374 ENDIF 1375 IF( (nbondj == 1 .OR. nbondj == 2) .AND. jperio < 3 ) THEN 1376 DO jn = 1, 4 ! (North or jpnj = 1), no north fold 1377 z_bnds(jn,:,nlcj,1) = plat_pnt(:,nlcj) ; z_bnds(jn,:,nlcj,2) = plon_pnt(:,nlcj) 1378 END DO 1379 ENDIF 1388 1380 ENDIF 1389 1381 … … 1412 1404 bounds_lon = RESHAPE(z_bnds(:,nldi:nlei,nldj:nlej,2),(/ 4,ni*nj /)), nvertex=4 ) 1413 1405 1414 DEALLOCATE( z_bnds, z_ cnr, z_pnt, z_fld, z_rot )1406 DEALLOCATE( z_bnds, z_fld, z_rot ) 1415 1407 1416 1408 END SUBROUTINE set_grid_bounds … … 1424 1416 !! 1425 1417 !!---------------------------------------------------------------------- 1426 REAL(wp), DIMENSION(1) :: zz = 1. 1418 REAL(wp), DIMENSION(1) :: zz = 0. 1419 REAL(wp), DIMENSION(4,1) :: z_lat, z_lon 1427 1420 !!---------------------------------------------------------------------- 1428 1421 CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 1429 1422 CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 1423 1424 z_lon(1,:) = MINVAL(glamt) ; z_lon(2,:) = MAXVAL(glamt) ; z_lon(3,:) = MAXVAL(glamt) ; z_lon(4,:) = MINVAL(glamt) 1425 z_lat(1,:) = MINVAL(gphit) ; z_lat(2,:) = MINVAL(gphit) ; z_lat(3,:) = MAXVAL(gphit) ; z_lat(4,:) = MAXVAL(gphit) 1426 1427 IF( lk_mpp ) THEN 1428 CALL mpp_min( z_lon(1,1) ) ; CALL mpp_min( z_lon(4,1) ) ; CALL mpp_max( z_lon(2,1) ) ; CALL mpp_max( z_lon(3,1) ) 1429 CALL mpp_min( z_lat(1,1) ) ; CALL mpp_min( z_lat(2,1) ) ; CALL mpp_max( z_lat(3,1) ) ; CALL mpp_max( z_lat(4,1) ) 1430 ENDIF 1431 1432 CALL iom_set_domain_attr('globalscalar', lonvalue=zz, latvalue=zz, bounds_lon=z_lon, bounds_lat=z_lat, nvertex=4) 1433 1430 1434 zz=REAL(narea,wp) 1431 CALL iom_set_domain_attr(' scalarpoint', lonvalue=zz, latvalue=zz)1435 CALL iom_set_domain_attr('1point', lonvalue=zz, latvalue=zz) 1432 1436 1433 1437 END SUBROUTINE set_scalar
Note: See TracChangeset
for help on using the changeset viewer.