Changeset 5118
- Timestamp:
- 2015-03-03T14:36:04+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/DOC/TexFiles/Chapters/Chap_MISC.tex
r4147 r5118 141 141 computational domain is laid out on local processor memories following a 2D 142 142 horizontal splitting. % (see {\S}IV.2-c) ref to the section to be updated 143 144 \subsection{Simple subsetting of input files via netCDF attributes} 145 146 The extended grids for use with the under-shelf ice cavities will result in redundant rows 147 around Antarctica if the ice cavities are not active. A simple mechanism for subsetting 148 input files associated with the extended domains has been implemented to avoid the need to 149 maintain different sets of input fields for use with or without active ice cavities. The 150 existing 'zoom' options are overly complex for this task and marked for deletion anyway. 151 This alternative subsetting operates for the j-direction only and works by optionally 152 looking for and using a global file attribute (named: \np{open\_ocean\_jstart}) to 153 determine the starting j-row for input. The use of this option is best explained with an 154 example: Consider an ORCA1 configuration using the extended grid bathymetry and coordinate 155 files: 156 \vspace{-10pt} 157 \begin{alltt} 158 \tiny 159 \begin{verbatim} 160 eORCA1_bathymetry_v2.nc 161 eORCA1_coordinates.nc 162 \end{verbatim} 163 \end{alltt} 164 \noindent These files define a horizontal domain of 362x332. Assuming the first row with 165 open ocean wet points in the non-isf bathymetry for this set is row 42 (Fortran indexing) 166 then the formally correct setting for \np{open\_ocean\_jstart} is 41. Using this value as the 167 first row to be read will result in a 362x292 domain which is the same size as the original 168 ORCA1 domain. Thus the extended coordinates and bathymetry files can be used with all the 169 original input files for ORCA1 if the ice cavities are not active (\np{ln\_isfcav = 170 .false.}). Full instructions for achieving this are: 171 172 \noindent Add the new attribute to any input files requiring a j-row offset, i.e: 173 \vspace{-10pt} 174 \begin{alltt} 175 \tiny 176 \begin{verbatim} 177 ncatted -a open_ocean_jstart,global,a,d,41 eORCA1_coordinates.nc 178 ncatted -a open_ocean_jstart,global,a,d,41 eORCA1_bathymetry_v2.nc 179 \end{verbatim} 180 \end{alltt} 181 182 \noindent Add the logical switch to \ngn{namcfg} in the configuration namelist and set true: 183 %--------------------------------------------namcfg-------------------------------------------------------- 184 \namdisplay{namcfg_orca1} 185 %-------------------------------------------------------------------------------------------------------------- 186 187 \noindent Note the j-size of the global domain is the (extended j-size minus 188 \np{open\_ocean\_jstart} + 1 ) and this must match the size of all datasets other than 189 bathymetry and coordinates currently. However the option can be extended to any global, 2D 190 and 3D, netcdf, input field by adding the: 191 \vspace{-10pt} 192 \begin{alltt} 193 \tiny 194 \begin{verbatim} 195 lrowattr=ln_use_jattr 196 \end{verbatim} 197 \end{alltt} 198 optional argument to the appropriate \np{iom\_get} call and the \np{open\_ocean\_jstart} attribute to the corresponding input files. It remains the users responsibility to set \np{jpjdta} and \np{jpjglo} values in the \np{namelist\_cfg} file according to their needs. 143 199 144 200 %>>>>>>>>>>>>>>>>>>>>>>>>>>>> -
trunk/NEMOGCM/ARCH/arch-X64_MOBILIS.fcm
r4865 r5118 36 36 %NCDF_HOME /home/acc/shared 37 37 %HDF5_HOME /home/acc/shared 38 %XIOS_HOME /home/acc/XIOS 38 %XIOS_HOME /home/acc/XIOS_1.0 39 39 %OASIS_HOME 40 40 -
trunk/NEMOGCM/CONFIG/SHARED/namelist_ref
r5109 r5118 76 76 ! = 5 North fold F-point pivot 77 77 ! = 6 cyclic East-West AND North fold F-point pivot 78 ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present 79 ! in netcdf input files, as the start j-row for reading 78 80 / 79 81 !----------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r5039 r5118 149 149 & nn_bench, nn_timing 150 150 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 151 & jpizoom, jpjzoom, jperio 151 & jpizoom, jpjzoom, jperio, ln_use_jattr 152 152 !!---------------------------------------------------------------------- 153 153 cltxt = '' … … 359 359 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 360 360 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 361 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 361 362 ENDIF 362 363 ! ! Parameter control -
trunk/NEMOGCM/NEMO/OOO_SRC/nemogcm.F90
r4990 r5118 129 129 & nn_bench, nn_timing 130 130 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 131 & jpizoom, jpjzoom, jperio 131 & jpizoom, jpjzoom, jperio, ln_use_jattr 132 132 !!---------------------------------------------------------------------- 133 133 ! -
trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90
r4990 r5118 616 616 CALL iom_open( 'coordinates', inum ) 617 617 618 CALL iom_get( inum, jpdom_data, 'glamt', glamt )619 CALL iom_get( inum, jpdom_data, 'glamu', glamu )620 CALL iom_get( inum, jpdom_data, 'glamv', glamv )621 CALL iom_get( inum, jpdom_data, 'glamf', glamf )622 623 CALL iom_get( inum, jpdom_data, 'gphit', gphit )624 CALL iom_get( inum, jpdom_data, 'gphiu', gphiu )625 CALL iom_get( inum, jpdom_data, 'gphiv', gphiv )626 CALL iom_get( inum, jpdom_data, 'gphif', gphif )627 628 CALL iom_get( inum, jpdom_data, 'e1t', e1t )629 CALL iom_get( inum, jpdom_data, 'e1u', e1u )630 CALL iom_get( inum, jpdom_data, 'e1v', e1v )631 CALL iom_get( inum, jpdom_data, 'e1f', e1f )632 633 CALL iom_get( inum, jpdom_data, 'e2t', e2t )634 CALL iom_get( inum, jpdom_data, 'e2u', e2u )635 CALL iom_get( inum, jpdom_data, 'e2v', e2v )636 CALL iom_get( inum, jpdom_data, 'e2f', e2f )618 CALL iom_get( inum, jpdom_data, 'glamt', glamt, lrowattr=ln_use_jattr ) 619 CALL iom_get( inum, jpdom_data, 'glamu', glamu, lrowattr=ln_use_jattr ) 620 CALL iom_get( inum, jpdom_data, 'glamv', glamv, lrowattr=ln_use_jattr ) 621 CALL iom_get( inum, jpdom_data, 'glamf', glamf, lrowattr=ln_use_jattr ) 622 623 CALL iom_get( inum, jpdom_data, 'gphit', gphit, lrowattr=ln_use_jattr ) 624 CALL iom_get( inum, jpdom_data, 'gphiu', gphiu, lrowattr=ln_use_jattr ) 625 CALL iom_get( inum, jpdom_data, 'gphiv', gphiv, lrowattr=ln_use_jattr ) 626 CALL iom_get( inum, jpdom_data, 'gphif', gphif, lrowattr=ln_use_jattr ) 627 628 CALL iom_get( inum, jpdom_data, 'e1t', e1t, lrowattr=ln_use_jattr ) 629 CALL iom_get( inum, jpdom_data, 'e1u', e1u, lrowattr=ln_use_jattr ) 630 CALL iom_get( inum, jpdom_data, 'e1v', e1v, lrowattr=ln_use_jattr ) 631 CALL iom_get( inum, jpdom_data, 'e1f', e1f, lrowattr=ln_use_jattr ) 632 633 CALL iom_get( inum, jpdom_data, 'e2t', e2t, lrowattr=ln_use_jattr ) 634 CALL iom_get( inum, jpdom_data, 'e2u', e2u, lrowattr=ln_use_jattr ) 635 CALL iom_get( inum, jpdom_data, 'e2v', e2v, lrowattr=ln_use_jattr ) 636 CALL iom_get( inum, jpdom_data, 'e2f', e2f, lrowattr=ln_use_jattr ) 637 637 638 638 CALL iom_close( inum ) -
trunk/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
r5040 r5118 534 534 IF( ln_zps .OR. ln_sco ) THEN ! zps or sco : read meter bathymetry 535 535 CALL iom_open ( 'bathy_meter.nc', inum ) 536 CALL iom_get ( inum, jpdom_data, 'Bathymetry', bathy ) 536 IF ( ln_isfcav ) THEN 537 CALL iom_get ( inum, jpdom_data, 'Bathymetry_isf', bathy, lrowattr=.false. ) 538 ELSE 539 CALL iom_get ( inum, jpdom_data, 'Bathymetry' , bathy, lrowattr=ln_use_jattr ) 540 END IF 537 541 CALL iom_close( inum ) 538 542 ! -
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r5043 r5118 543 543 END SUBROUTINE iom_g1d 544 544 545 SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )545 SUBROUTINE iom_g2d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr ) 546 546 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 547 547 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 551 551 INTEGER , INTENT(in ), DIMENSION(2) , OPTIONAL :: kstart ! start axis position of the reading 552 552 INTEGER , INTENT(in ), DIMENSION(2) , OPTIONAL :: kcount ! number of points in each axis 553 LOGICAL , INTENT(in ) , OPTIONAL :: lrowattr ! logical flag telling iom_get to 554 ! look for and use a file attribute 555 ! called open_ocean_jstart to set the start 556 ! value for the 2nd dimension (netcdf only) 553 557 ! 554 558 IF( kiomid > 0 ) THEN 555 559 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom , cdvar , pv_r2d=pvar, & 556 & ktime=ktime, kstart=kstart, kcount=kcount ) 560 & ktime=ktime, kstart=kstart, kcount=kcount, & 561 & lrowattr=lrowattr ) 557 562 ENDIF 558 563 END SUBROUTINE iom_g2d 559 564 560 SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount )565 SUBROUTINE iom_g3d( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount, lrowattr ) 561 566 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 562 567 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 566 571 INTEGER , INTENT(in ), DIMENSION(3) , OPTIONAL :: kstart ! start axis position of the reading 567 572 INTEGER , INTENT(in ), DIMENSION(3) , OPTIONAL :: kcount ! number of points in each axis 573 LOGICAL , INTENT(in ) , OPTIONAL :: lrowattr ! logical flag telling iom_get to 574 ! look for and use a file attribute 575 ! called open_ocean_jstart to set the start 576 ! value for the 2nd dimension (netcdf only) 568 577 ! 569 578 IF( kiomid > 0 ) THEN 570 579 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom , cdvar , pv_r3d=pvar, & 571 & ktime=ktime, kstart=kstart, kcount=kcount ) 580 & ktime=ktime, kstart=kstart, kcount=kcount, & 581 & lrowattr=lrowattr ) 572 582 ENDIF 573 583 END SUBROUTINE iom_g3d … … 576 586 SUBROUTINE iom_get_123d( kiomid, kdom , cdvar , & 577 587 & pv_r1d, pv_r2d, pv_r3d, & 578 & ktime , kstart, kcount ) 588 & ktime , kstart, kcount, & 589 & lrowattr ) 579 590 !!----------------------------------------------------------------------- 580 591 !! *** ROUTINE iom_get_123d *** … … 593 604 INTEGER , DIMENSION(:) , INTENT(in ), OPTIONAL :: kstart ! start position of the reading in each axis 594 605 INTEGER , DIMENSION(:) , INTENT(in ), OPTIONAL :: kcount ! number of points to be read in each axis 606 LOGICAL , INTENT(in ), OPTIONAL :: lrowattr ! logical flag telling iom_get to 607 ! look for and use a file attribute 608 ! called open_ocean_jstart to set the start 609 ! value for the 2nd dimension (netcdf only) 595 610 ! 596 611 LOGICAL :: llnoov ! local definition to read overlap 612 LOGICAL :: luse_jattr ! local definition to read open_ocean_jstart file attribute 613 INTEGER :: jstartrow ! start point for 2nd dimension optionally set by file attribute 597 614 INTEGER :: jl ! loop on number of dimension 598 615 INTEGER :: idom ! type of domain … … 604 621 INTEGER :: ix1, ix2, iy1, iy2 ! subdomain indexes 605 622 INTEGER :: ji, jj ! loop counters 606 INTEGER :: irankpv 623 INTEGER :: irankpv ! 607 624 INTEGER :: ind1, ind2 ! substring index 608 625 INTEGER, DIMENSION(jpmax_dims) :: istart ! starting point to read for each axis … … 628 645 IF( PRESENT(kstart) .AND. (.NOT. PRESENT(kcount)) ) CALL ctl_stop(trim(clinfo), 'kstart present needs kcount present') 629 646 IF( PRESENT(kstart) .AND. idom /= jpdom_unknown ) CALL ctl_stop(trim(clinfo), 'kstart present needs kdom = jpdom_unknown') 647 648 luse_jattr = .false. 649 IF( PRESENT(lrowattr) ) THEN 650 IF( lrowattr .AND. idom /= jpdom_data ) CALL ctl_stop(trim(clinfo), 'lrowattr present and true needs kdom = jpdom_data') 651 IF( lrowattr .AND. idom == jpdom_data ) luse_jattr = .true. 652 ENDIF 653 IF( luse_jattr ) THEN 654 SELECT CASE (iom_file(kiomid)%iolib) 655 CASE (jpioipsl, jprstdimg ) 656 CALL ctl_warn(trim(clinfo), 'lrowattr present and true but this only works with netcdf (jpnf90)') 657 luse_jattr = .false. 658 CASE (jpnf90 ) 659 ! Ok 660 CASE DEFAULT 661 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 662 END SELECT 663 ENDIF 630 664 631 665 ! Search for the variable in the data base (eventually actualize data) … … 701 735 ELSE 702 736 IF( .NOT. PRESENT(pv_r1d) ) THEN ! not a 1D array 703 IF( idom == jpdom_data ) THEN ; istart(1:2) = (/ mig(1), mjg(1) /) ! icnt(1:2) done bellow 704 ELSEIF( idom == jpdom_global ) THEN ; istart(1:2) = (/ nimpp , njmpp /) ! icnt(1:2) done bellow 737 IF( idom == jpdom_data ) THEN 738 jstartrow = 1 739 IF( luse_jattr ) THEN 740 CALL iom_getatt(kiomid, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 741 jstartrow = MAX(1,jstartrow) 742 ENDIF 743 istart(1:2) = (/ mig(1), mjg(1) + jstartrow - 1 /) ! icnt(1:2) done below 744 ELSEIF( idom == jpdom_global ) THEN ; istart(1:2) = (/ nimpp , njmpp /) ! icnt(1:2) done below 705 745 ENDIF 706 746 ! we do not read the overlap -> we start to read at nldi, nldj -
trunk/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
r4990 r5118 45 45 INTEGER :: inum ! temporary logical unit 46 46 INTEGER :: idir ! temporary integers 47 INTEGER :: jstartrow ! temporary integers 47 48 INTEGER :: ios ! Local integer output status for namelist read 48 49 INTEGER :: & … … 100 101 ! open the file 101 102 ! Remember that at this level in the code, mpp is not yet initialized, so 102 ! the file must be open with jpdom_unknown, and kstart amd kcount forced 103 ! the file must be open with jpdom_unknown, and kstart and kcount forced 104 jstartrow = 1 103 105 IF ( ln_zco ) THEN 104 106 CALL iom_open ( 'bathy_level.nc', inum ) ! Level bathymetry 105 CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 107 ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 108 ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 109 CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 110 jstartrow = MAX(1,jstartrow) 111 CALL iom_get ( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 106 112 ELSE 107 113 CALL iom_open ( 'bathy_meter.nc', inum ) ! Meter bathy in case of partial steps 108 CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 114 IF ( ln_isfcav ) THEN 115 CALL iom_get ( inum, jpdom_unknown, 'Bathymetry_isf' , zdta, kstart=(/jpizoom,jpjzoom/), kcount=(/jpiglo,jpjglo/) ) 116 ELSE 117 ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 118 ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 119 CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 120 jstartrow = MAX(1,jstartrow) 121 CALL iom_get ( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/jpizoom,jpjzoom+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 122 ENDIF 109 123 ENDIF 110 124 CALL iom_close (inum) -
trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r4990 r5118 222 222 & nn_bench, nn_timing 223 223 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 224 & jpizoom, jpjzoom, jperio 224 & jpizoom, jpjzoom, jperio, ln_use_jattr 225 225 !!---------------------------------------------------------------------- 226 226 ! … … 261 261 nperio = 0 262 262 jperio = 0 263 ln_use_jattr = .false. 263 264 ENDIF 264 265 #endif … … 506 507 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 507 508 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 509 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 508 510 ENDIF 509 511 ! ! Parameter control -
trunk/NEMOGCM/NEMO/OPA_SRC/par_oce.F90
r4990 r5118 53 53 ! ! = 6 cyclic East-West AND North fold F-point pivot 54 54 55 ! Input file read offset 56 LOGICAL :: ln_use_jattr !: Use file global attribute: open_ocean_jstart to determine start j-row 57 ! when reading input from those netcdf files that have the 58 ! attribute defined. This is designed to enable input files associated 59 ! with the extended grids used in the under ice shelf configurations to 60 ! be used without redundant rows when the ice shelves are not in use. 61 55 62 !! Values set to pp_not_used indicates that this parameter is not used in THIS config. 56 63 !! Values set to pp_to_be_computed indicates that variables will be computed in domzgr -
trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
r4624 r5118 161 161 & nn_bench, nn_timing 162 162 NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 163 & jpizoom, jpjzoom, jperio 163 & jpizoom, jpjzoom, jperio, ln_use_jattr 164 164 !!---------------------------------------------------------------------- 165 165 cltxt = '' … … 348 348 WRITE(numout,*) ' left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 349 349 WRITE(numout,*) ' lateral cond. type (between 0 and 6) jperio = ', jperio 350 WRITE(numout,*) ' use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 350 351 ENDIF 351 352 ! ! Parameter control
Note: See TracChangeset
for help on using the changeset viewer.