Changeset 14365
- Timestamp:
- 2021-02-01T10:50:40+01:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/DOM/domain.F90
r14337 r14365 629 629 CHARACTER(len=1), INTENT(out) :: cdNFtype ! Folding type: T or F 630 630 ! 631 INTEGER :: inum, iperio ! local integer 631 CHARACTER(len=7) :: catt ! 'T', 'F', '-' or 'UNKNOWN' 632 INTEGER :: inum, iperio, iatt ! local integer 632 633 REAL(wp) :: zorca_res ! local scalars 633 REAL(wp) :: zperio , z01! - -634 REAL(wp) :: zperio ! - - 634 635 INTEGER, DIMENSION(4) :: idvar, idimsz ! size of dimensions 635 636 !!---------------------------------------------------------------------- … … 643 644 CALL iom_open( cn_domcfg, inum ) 644 645 ! 645 ! !- ORCA family specificity 646 IF( iom_varid( inum, 'ORCA' , ldstop = .FALSE. ) > 0 .AND. & 647 & iom_varid( inum, 'ORCA_index' , ldstop = .FALSE. ) > 0 ) THEN 648 ! 649 cd_cfg = 'ORCA' 650 CALL iom_get( inum, 'ORCA_index', zorca_res ) ; kk_cfg = NINT( zorca_res ) 651 ! 652 IF(lwp) THEN 653 WRITE(numout,*) ' .' 654 WRITE(numout,*) ' ==>>> ORCA configuration ' 655 WRITE(numout,*) ' .' 646 CALL iom_getatt( inum, 'CfgName', cd_cfg ) ! returns 'UNKNOWN' if not found 647 CALL iom_getatt( inum, 'CfgIndex', kk_cfg ) ! returns -999 if not found 648 ! 649 ! ------- keep compatibility with OLD VERSION... start ------- 650 IF( cd_cfg == 'UNKNOWN' .AND. kk_cfg == -999 ) THEN 651 IF( iom_varid( inum, 'ORCA' , ldstop = .FALSE. ) > 0 .AND. & 652 & iom_varid( inum, 'ORCA_index' , ldstop = .FALSE. ) > 0 ) THEN 653 ! 654 cd_cfg = 'ORCA' 655 CALL iom_get( inum, 'ORCA_index', zorca_res ) ; kk_cfg = NINT( zorca_res ) 656 ! 657 ELSE 658 CALL iom_getatt( inum, 'cn_cfg', cd_cfg ) ! returns 'UNKNOWN' if not found 659 CALL iom_getatt( inum, 'nn_cfg', kk_cfg ) ! returns -999 if not found 656 660 ENDIF 657 ! 658 ELSE !- cd_cfg & k_cfg are not used 659 cd_cfg = 'UNKNOWN' 660 kk_cfg = -9999999 661 !- or they may be present as global attributes 662 !- (netcdf only) 663 CALL iom_getatt( inum, 'cn_cfg', cd_cfg ) ! returns ! if not found 664 CALL iom_getatt( inum, 'nn_cfg', kk_cfg ) ! returns -999 if not found 665 IF( TRIM(cd_cfg) == '!') cd_cfg = 'UNKNOWN' 666 IF( kk_cfg == -999 ) kk_cfg = -9999999 667 ! 668 ENDIF 669 ! 661 ENDIF 662 ! ------- keep compatibility with OLD VERSION... end ------- 663 ! 670 664 idvar = iom_varid( inum, 'e3t_0', kdimsz = idimsz ) ! use e3t_0, that must exist, to get jp(ijk)glo 671 665 kpi = idimsz(1) … … 673 667 kpk = idimsz(3) 674 668 ! 675 IF( iom_varid( inum, 'jperio', ldstop = .FALSE. ) > 0 ) THEN ! keep compatibility with old version... 669 CALL iom_getatt( inum, 'Iperio', iatt ) ; ldIperio = iatt == 1 ! returns -999 if not found -> default = .false. 670 CALL iom_getatt( inum, 'Jperio', iatt ) ; ldJperio = iatt == 1 ! returns -999 if not found -> default = .false. 671 CALL iom_getatt( inum, 'NFold', iatt ) ; ldNFold = iatt == 1 ! returns -999 if not found -> default = .false. 672 CALL iom_getatt( inum, 'NFtype', catt ) ! returns 'UNKNOWN' if not found 673 IF( LEN_TRIM(catt) == 1 ) THEN ; cdNFtype = TRIM(catt) 674 ELSE ; cdNFtype = '-' 675 ENDIF 676 ! 677 ! ------- keep compatibility with OLD VERSION... start ------- 678 IF( iatt == -999 .AND. catt == 'UNKNOWN' .AND. iom_varid( inum, 'jperio', ldstop = .FALSE. ) > 0 ) THEN 676 679 CALL iom_get( inum, 'jperio', zperio ) ; iperio = NINT( zperio ) 677 680 ldIperio = iperio == 1 .OR. iperio == 4 .OR. iperio == 6 .OR. iperio == 7 ! i-periodicity … … 682 685 ELSE ; cdNFtype = '-' ! default value 683 686 ENDIF 684 ELSE 685 z01 = 0._wp ; IF( iom_varid( inum, 'Iperio', ldstop = .FALSE. ) > 0 ) CALL iom_get( inum, 'Iperio', z01 ) 686 ldIperio = NINT(z01) == 1 ! i-periodicity 687 z01 = 0._wp ; IF( iom_varid( inum, 'Jperio', ldstop = .FALSE. ) > 0 ) CALL iom_get( inum, 'Jperio', z01 ) 688 ldJperio = NINT(z01) == 1 ! j-periodicity 689 cdNFtype = '-' ! default definition 690 z01 = 0._wp ; IF( iom_varid( inum, 'NFoldT', ldstop = .FALSE. ) > 0 ) CALL iom_get( inum, 'NFoldT', z01 ) 691 IF( NINT(z01) == 1 ) cdNFtype = 'T' ! folding at T point 692 z01 = 0._wp ; IF( iom_varid( inum, 'NFoldF', ldstop = .FALSE. ) > 0 ) CALL iom_get( inum, 'NFoldF', z01 ) 693 IF( NINT(z01) == 1 ) cdNFtype = 'F' ! folding at T point 694 ldNFold = cdNFtype /= '-' ! North pole folding 695 ENDIF 687 ENDIF 688 ! ------- keep compatibility with OLD VERSION... end ------- 689 ! 696 690 CALL iom_close( inum ) 697 691 ! 698 692 IF(lwp) THEN 699 WRITE(numout,*) ' cn_cfg = ', TRIM(cd_cfg), ' nn_cfg = ', kk_cfg 693 WRITE(numout,*) ' .' 694 WRITE(numout,*) ' ==>>> ', TRIM(cn_cfg), ' configuration ' 695 WRITE(numout,*) ' .' 696 WRITE(numout,*) ' nn_cfg = ', kk_cfg 700 697 WRITE(numout,*) ' Ni0glo = ', kpi 701 698 WRITE(numout,*) ' Nj0glo = ', kpj … … 738 735 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 739 736 ! 740 ! !== ORCA family specificities ==! 741 IF( TRIM(cn_cfg) == "orca" .OR. TRIM(cn_cfg) == "ORCA" ) THEN 742 CALL iom_rstput( 0, 0, inum, 'ORCA' , 1._wp , ktype = jp_i4 ) 743 CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 ) 744 ENDIF 737 ! !== Configuration specificities ==! 738 ! 739 CALL iom_putatt( inum, 'CfgName', TRIM(cn_cfg) ) 740 CALL iom_putatt( inum, 'CfgIndex', nn_cfg ) 745 741 ! 746 742 ! !== domain characteristics ==! 747 743 ! 748 744 ! ! lateral boundary of the global domain 749 CALL iom_ rstput( 0, 0, inum, 'Iperio', REAL( COUNT( (/l_Iperio/) ), wp), ktype = jp_i1)750 CALL iom_ rstput( 0, 0, inum, 'Jperio', REAL( COUNT( (/l_Jperio/) ), wp), ktype = jp_i1)751 CALL iom_ rstput( 0, 0, inum, 'NFoldT', REAL( COUNT( (/c_NFtype == 'T'/) ), wp), ktype = jp_i1)752 CALL iom_ rstput( 0, 0, inum, 'NFoldF', REAL( COUNT( (/c_NFtype == 'F'/) ), wp), ktype = jp_i1)753 ! 745 CALL iom_putatt( inum, 'Iperio', COUNT( (/l_Iperio/) ) ) 746 CALL iom_putatt( inum, 'Jperio', COUNT( (/l_Jperio/) ) ) 747 CALL iom_putatt( inum, 'NFold', COUNT( (/l_NFold /) ) ) 748 CALL iom_putatt( inum, 'NFtype', c_NFtype ) 749 754 750 ! ! type of vertical coordinate 755 CALL iom_rstput( 0, 0, inum, 'ln_zco', REAL(COUNT((/ln_zco/)), wp), ktype = jp_i4)756 CALL iom_rstput( 0, 0, inum, 'ln_zps', REAL(COUNT((/ln_zps/)), wp), ktype = jp_i4)757 CALL iom_rstput( 0, 0, inum, 'ln_sco', REAL(COUNT((/ln_sco/)), wp), ktype = jp_i4)758 !751 IF(ln_zco) CALL iom_putatt( inum, 'VertCoord', 'zco' ) 752 IF(ln_zps) CALL iom_putatt( inum, 'VertCoord', 'zps' ) 753 IF(ln_sco) CALL iom_putatt( inum, 'VertCoord', 'sco' ) 754 759 755 ! ! ocean cavities under iceshelves 760 CALL iom_ rstput( 0, 0, inum, 'ln_isfcav', REAL(COUNT((/ln_isfcav/)), wp), ktype = jp_i4)756 CALL iom_putatt( inum, 'IsfCav', COUNT( (/ln_isfcav/) ) ) 761 757 ! 762 758 ! !== horizontal mesh ! … … 811 807 CALL iom_rstput( 0, 0, inum, 'ht_0' , ht_0 , ktype = jp_r8 ) 812 808 ENDIF 813 ! 814 ! Add some global attributes ( netcdf only ) 815 CALL iom_putatt( inum, 'nn_cfg', nn_cfg ) 816 CALL iom_putatt( inum, 'cn_cfg', TRIM(cn_cfg) ) 817 ! 818 ! ! ============================ 819 ! ! close the files 820 ! ! ============================ 809 ! ! ============================ ! 810 ! ! close the files 811 ! ! ============================ ! 821 812 CALL iom_close( inum ) 822 813 ! -
NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/DOM/domwri.F90
r14336 r14365 58 58 CHARACTER(len=21) :: clnam ! filename (mesh and mask informations) 59 59 INTEGER :: ji, jj, jk ! dummy loop indices 60 INTEGER :: izco, izps, isco, icav61 !62 60 REAL(wp), DIMENSION(jpi,jpj) :: zprt, zprw ! 2D workspace 63 61 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zdepu, zdepv ! 3D workspace … … 74 72 ! ! ============================ 75 73 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 76 ! ! domain characteristics 77 CALL iom_rstput( 0, 0, inum, 'Iperio', REAL( COUNT( (/l_Iperio/) ), wp), ktype = jp_i1 ) 78 CALL iom_rstput( 0, 0, inum, 'Jperio', REAL( COUNT( (/l_Jperio/) ), wp), ktype = jp_i1 ) 79 CALL iom_rstput( 0, 0, inum, 'NFoldT', REAL( COUNT( (/c_NFtype == 'T'/) ), wp), ktype = jp_i1 ) 80 CALL iom_rstput( 0, 0, inum, 'NFoldF', REAL( COUNT( (/c_NFtype == 'F'/) ), wp), ktype = jp_i1 ) 74 ! ! Configuration specificities 75 CALL iom_putatt( inum, 'CfgName', TRIM(cn_cfg) ) 76 CALL iom_putatt( inum, 'CfgIndex', nn_cfg ) 77 ! ! lateral boundary of the global domain 78 CALL iom_putatt( inum, 'Iperio', COUNT( (/l_Iperio/) ) ) 79 CALL iom_putatt( inum, 'Jperio', COUNT( (/l_Jperio/) ) ) 80 CALL iom_putatt( inum, 'NFold', COUNT( (/l_NFold /) ) ) 81 CALL iom_putatt( inum, 'NFtype', c_NFtype ) 81 82 ! ! type of vertical coordinate 82 IF( ln_zco ) THEN ; izco = 1 ; ELSE ; izco = 0 ; ENDIF 83 IF( ln_zps ) THEN ; izps = 1 ; ELSE ; izps = 0 ; ENDIF 84 IF( ln_sco ) THEN ; isco = 1 ; ELSE ; isco = 0 ; ENDIF 85 CALL iom_rstput( 0, 0, inum, 'ln_zco' , REAL( izco, wp), ktype = jp_i4 ) 86 CALL iom_rstput( 0, 0, inum, 'ln_zps' , REAL( izps, wp), ktype = jp_i4 ) 87 CALL iom_rstput( 0, 0, inum, 'ln_sco' , REAL( isco, wp), ktype = jp_i4 ) 83 IF(ln_zco) CALL iom_putatt( inum, 'VertCoord', 'zco' ) 84 IF(ln_zps) CALL iom_putatt( inum, 'VertCoord', 'zps' ) 85 IF(ln_sco) CALL iom_putatt( inum, 'VertCoord', 'sco' ) 88 86 ! ! ocean cavities under iceshelves 89 IF( ln_isfcav ) THEN ; icav = 1 ; ELSE ; icav = 0 ; ENDIF 90 CALL iom_rstput( 0, 0, inum, 'ln_isfcav', REAL( icav, wp), ktype = jp_i4 ) 91 87 CALL iom_putatt( inum, 'IsfCav', COUNT( (/ln_isfcav/) ) ) 92 88 ! ! masks 93 89 CALL iom_rstput( 0, 0, inum, 'tmask', tmask, ktype = jp_i1 ) ! ! land-sea mask -
NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/DOM/domzgr.F90
r14336 r14365 225 225 ! 226 226 INTEGER :: jk ! dummy loop index 227 INTEGER :: inum ! local logical unit227 INTEGER :: inum, iatt 228 228 REAL(WP) :: z_zco, z_zps, z_sco, z_cav 229 229 REAL(wp), DIMENSION(jpi,jpj) :: z2d ! 2D workspace 230 CHARACTER(len=7) :: catt ! 'zco', 'zps, 'sco' or 'UNKNOWN' 230 231 !!---------------------------------------------------------------------- 231 232 ! … … 239 240 ! 240 241 ! !* type of vertical coordinate 241 CALL iom_get( inum, 'ln_zco' , z_zco ) 242 CALL iom_get( inum, 'ln_zps' , z_zps ) 243 CALL iom_get( inum, 'ln_sco' , z_sco ) 244 IF( z_zco == 0._wp ) THEN ; ld_zco = .false. ; ELSE ; ld_zco = .true. ; ENDIF 245 IF( z_zps == 0._wp ) THEN ; ld_zps = .false. ; ELSE ; ld_zps = .true. ; ENDIF 246 IF( z_sco == 0._wp ) THEN ; ld_sco = .false. ; ELSE ; ld_sco = .true. ; ENDIF 247 ! 242 CALL iom_getatt( inum, 'VertCoord', catt ) ! returns 'UNKNOWN' if not found 243 ld_zco = catt == 'zco' ! default = .false. 244 ld_zps = catt == 'zps' ! default = .false. 245 ld_sco = catt == 'sco' ! default = .false. 248 246 ! !* ocean cavities under iceshelves 249 CALL iom_get( inum, 'ln_isfcav', z_cav ) 250 IF( z_cav == 0._wp ) THEN ; ld_isfcav = .false. ; ELSE ; ld_isfcav = .true. ; ENDIF 247 CALL iom_getatt( inum, 'IsfCav', iatt ) ! returns -999 if not found 248 ld_isfcav = iatt == 1 ! default = .false. 249 ! 250 ! ------- keep compatibility with OLD VERSION... start ------- 251 IF( catt == 'UNKNOWN' ) THEN 252 CALL iom_get( inum, 'ln_zco', z_zco ) ; ld_zco = z_zco /= 0._wp 253 CALL iom_get( inum, 'ln_zps', z_zps ) ; ld_zps = z_zps /= 0._wp 254 CALL iom_get( inum, 'ln_sco', z_sco ) ; ld_sco = z_sco /= 0._wp 255 ENDIF 256 IF( iatt == -999 ) THEN 257 CALL iom_get( inum, 'ln_isfcav', z_cav ) ; ld_isfcav = z_cav /= 0._wp 258 ENDIF 259 ! ------- keep compatibility with OLD VERSION... end ------- 251 260 ! 252 261 ! !* vertical scale factors -
NEMO/branches/2021/dev_r14312_MPI_Interface/src/OCE/IOM/iom_nf90.F90
r14072 r14365 443 443 IF(PRESENT(cdatt0d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = cdatt0d), clinfo) 444 444 ELSE 445 CALL ctl_warn('iom_nf90_getatt: no attribute '//TRIM(cdatt)//' found')446 445 IF(PRESENT( katt0d)) katt0d = -999 447 446 IF(PRESENT( katt1d)) katt1d(:) = -999 448 447 IF(PRESENT( patt0d)) patt0d = -999._wp 449 448 IF(PRESENT( patt1d)) patt1d(:) = -999._wp 450 IF(PRESENT(cdatt0d)) cdatt0d = ' !'449 IF(PRESENT(cdatt0d)) cdatt0d = 'UNKNOWN' 451 450 ENDIF 452 451 !
Note: See TracChangeset
for help on using the changeset viewer.