Changeset 10380
- Timestamp:
- 2018-12-11T09:27:54+01:00 (6 years ago)
- Location:
- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/ICE/icerst.F90
r10359 r10380 69 69 IF(lwp) THEN 70 70 WRITE(numout,*) 71 SELECT CASE ( jprstlib ) 72 CASE DEFAULT 73 WRITE(numout,*) ' open ice restart NetCDF file: ',TRIM(clpath)//clname 74 END SELECT 71 WRITE(numout,*) ' open ice restart NetCDF file: ',TRIM(clpath)//clname 75 72 IF( kt == nitrst - 2*nn_fsbc + 1 ) THEN 76 73 WRITE(numout,*) ' kt = nitrst - 2*nn_fsbc + 1 = ', kt,' date= ', ndastp … … 80 77 ENDIF 81 78 ! 82 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., k iolib = jprstlib, kdlev = jpl )79 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl ) 83 80 lrst_ice = .TRUE. 84 81 ENDIF … … 175 172 LOGICAL :: llok 176 173 INTEGER :: id1 ! local integer 177 INTEGER :: jlibalt = jprstlib178 174 CHARACTER(len=25) :: znam 179 175 CHARACTER(len=2) :: zchar, zchar1 … … 188 184 ENDIF 189 185 190 CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, k iolib = jprstlib, kdlev = jpl )186 CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir, kdlev = jpl ) 191 187 192 188 CALL iom_get( numrir, 'nn_fsbc', zfice ) -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/ASM/asmbkg.F90
r10068 r10380 85 85 ! 86 86 ! ! Define the output file 87 CALL iom_open( c_asmbkg, inum, ldwrt = .TRUE. , kiolib = jprstlib)87 CALL iom_open( c_asmbkg, inum, ldwrt = .TRUE. ) 88 88 ! 89 89 IF( nitbkg_r == nit000 - 1 ) THEN ! Treat special case when nitbkg = 0 … … 123 123 ! 124 124 ! ! Define the output file 125 CALL iom_open( c_asmdin, inum, ldwrt = .TRUE. , kiolib = jprstlib)125 CALL iom_open( c_asmdin, inum, ldwrt = .TRUE. ) 126 126 ! 127 127 IF( nitdin_r == nit000 - 1 ) THEN ! Treat special case when nitbkg = 0 -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/CRS/crsdomwri.F90
r10068 r10380 69 69 ! ! ============================ 70 70 ! 71 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. , kiolib = jprstlib)71 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 72 72 73 73 CALL iom_rstput( 0, 0, inum, 'tmask', tmask_crs, ktype = jp_i1 ) ! land-sea mask -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/DIA/diawri.F90
r10358 r10380 893 893 894 894 #if defined key_si3 895 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., k iolib = jprstlib, kdlev = jpl )895 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl ) 896 896 #else 897 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. , kiolib = jprstlib)897 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 898 898 #endif 899 899 -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/DOM/domain.F90
r10314 r10380 553 553 !- or they may be present as global attributes 554 554 !- (netcdf only) 555 IF( iom_file(inum)%iolib == jpnf90 ) THEN 556 CALL iom_getatt( inum, 'cn_cfg', cd_cfg ) ! returns ! if not found 557 CALL iom_getatt( inum, 'nn_cfg', kk_cfg ) ! returns -999 if not found 558 IF( TRIM(cd_cfg) == '!') cd_cfg = 'UNKNOWN' 559 IF( kk_cfg == -999 ) kk_cfg = -9999999 560 ENDIF 555 CALL iom_getatt( inum, 'cn_cfg', cd_cfg ) ! returns ! if not found 556 CALL iom_getatt( inum, 'nn_cfg', kk_cfg ) ! returns -999 if not found 557 IF( TRIM(cd_cfg) == '!') cd_cfg = 'UNKNOWN' 558 IF( kk_cfg == -999 ) kk_cfg = -9999999 561 559 ! 562 560 ENDIF … … 608 606 ! 609 607 clnam = cn_domcfg_out ! filename (configuration information) 610 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. , kiolib = jprstlib)608 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 611 609 612 610 ! … … 693 691 ! 694 692 ! Add some global attributes ( netcdf only ) 695 IF( iom_file(inum)%iolib == jpnf90 ) THEN 696 CALL iom_putatt( inum, 'nn_cfg', nn_cfg ) 697 CALL iom_putatt( inum, 'cn_cfg', TRIM(cn_cfg) ) 698 ENDIF 693 CALL iom_putatt( inum, 'nn_cfg', nn_cfg ) 694 CALL iom_putatt( inum, 'cn_cfg', TRIM(cn_cfg) ) 699 695 ! 700 696 ! ! ============================ -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/DOM/domwri.F90
r10297 r10380 72 72 ! ! create 'mesh_mask.nc' file 73 73 ! ! ============================ 74 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. , kiolib = jprstlib)74 CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 75 75 ! 76 76 ! ! global domain size -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/DOM/iscplrst.F90
r10170 r10380 82 82 cfile='correction' 83 83 cfile = TRIM( cfile ) 84 CALL iom_open ( cfile, inum0, ldwrt = .TRUE. , kiolib = jprstlib)84 CALL iom_open ( cfile, inum0, ldwrt = .TRUE. ) 85 85 CALL iom_rstput( 0, 0, inum0, 'vol_cor', hdiv_iscpl(:,:,:) ) 86 86 CALL iom_rstput( 0, 0, inum0, 'tem_cor', htsc_iscpl(:,:,:,jp_tem) ) -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/iom.F90
r10368 r10380 75 75 END INTERFACE 76 76 INTERFACE iom_getatt 77 MODULE PROCEDURE iom_g0d_iatt, iom_g 0d_ratt, iom_g0d_catt77 MODULE PROCEDURE iom_g0d_iatt, iom_g1d_iatt, iom_g0d_ratt, iom_g1d_ratt, iom_g0d_catt 78 78 END INTERFACE 79 79 INTERFACE iom_putatt 80 MODULE PROCEDURE iom_p0d_iatt, iom_p 0d_ratt, iom_p0d_catt80 MODULE PROCEDURE iom_p0d_iatt, iom_p1d_iatt, iom_p0d_ratt, iom_p1d_ratt, iom_p0d_catt 81 81 END INTERFACE 82 82 INTERFACE iom_rstput … … 634 634 635 635 636 SUBROUTINE iom_open( cdname, kiomid, ldwrt, kdom, kiolib,ldstop, ldiof, kdlev )636 SUBROUTINE iom_open( cdname, kiomid, ldwrt, kdom, ldstop, ldiof, kdlev ) 637 637 !!--------------------------------------------------------------------- 638 638 !! *** SUBROUTINE iom_open *** … … 644 644 LOGICAL , INTENT(in ), OPTIONAL :: ldwrt ! open in write modeb (default = .FALSE.) 645 645 INTEGER , INTENT(in ), OPTIONAL :: kdom ! Type of domain to be written (default = jpdom_local_noovlap) 646 INTEGER , INTENT(in ), OPTIONAL :: kiolib ! library used to open the file (default = jpnf90)647 646 LOGICAL , INTENT(in ), OPTIONAL :: ldstop ! stop if open to read a non-existing file (default = .TRUE.) 648 647 LOGICAL , INTENT(in ), OPTIONAL :: ldiof ! Interp On the Fly, needed for AGRIF (default = .FALSE.) … … 659 658 LOGICAL :: llstop ! local definition of ldstop 660 659 LOGICAL :: lliof ! local definition of ldiof 661 INTEGER :: iolib ! library do we use to open the file662 660 INTEGER :: icnt ! counter for digits in clcpu (max = jpmax_digits) 663 661 INTEGER :: iln, ils ! lengths of character … … 692 690 ELSE ; llstop = .TRUE. 693 691 ENDIF 694 ! what library do we use to open the file?695 IF( PRESENT(kiolib) ) THEN ; iolib = kiolib696 ELSE ; iolib = jpnf90697 ENDIF698 692 ! are we using interpolation on the fly? 699 693 IF( PRESENT(ldiof) ) THEN ; lliof = ldiof … … 713 707 ENDIF 714 708 ! which suffix should we use? 715 SELECT CASE (iolib) 716 CASE (jpnf90 ) ; clsuffix = '.nc' 717 CASE DEFAULT ; clsuffix = '' 718 CALL ctl_stop( TRIM(clinfo), 'accepted IO library is only jpnf90 (jpioipsl option has been removed) ' ) 719 END SELECT 709 clsuffix = '.nc' 720 710 ! Add the suffix if needed 721 711 iln = LEN_TRIM(clname) … … 802 792 ENDIF 803 793 IF( istop == nstop ) THEN ! no error within this routine 804 SELECT CASE (iolib) 805 CASE (jpnf90 ) ; CALL iom_nf90_open( clname, kiomid, llwrt, llok, idompar, kdlev = kdlev ) 806 CASE DEFAULT 807 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed) ' ) 808 END SELECT 794 CALL iom_nf90_open( clname, kiomid, llwrt, llok, idompar, kdlev = kdlev ) 809 795 ENDIF 810 796 ! … … 839 825 DO jf = i_s, i_e 840 826 IF( iom_file(jf)%nfid > 0 ) THEN 841 SELECT CASE (iom_file(jf)%iolib) 842 CASE (jpnf90 ) ; CALL iom_nf90_close( jf ) 843 CASE DEFAULT 844 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 845 END SELECT 827 CALL iom_nf90_close( jf ) 846 828 iom_file(jf)%nfid = 0 ! free the id 847 829 IF( PRESENT(kiomid) ) kiomid = 0 ! return 0 as id to specify that the file was closed … … 896 878 iiv = iiv + 1 897 879 IF( iiv <= jpmax_vars ) THEN 898 SELECT CASE (iom_file(kiomid)%iolib) 899 CASE (jpnf90 ) ; iom_varid = iom_nf90_varid ( kiomid, cdvar, iiv, kdimsz, kndims ) 900 CASE DEFAULT 901 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 902 END SELECT 880 iom_varid = iom_nf90_varid( kiomid, cdvar, iiv, kdimsz, kndims ) 903 881 ELSE 904 882 CALL ctl_stop( trim(clinfo), 'Too many variables in the file '//iom_file(kiomid)%name, & 905 & 883 & 'increase the parameter jpmax_vars') 906 884 ENDIF 907 885 IF( llstop .AND. iom_varid == -1 ) CALL ctl_stop( TRIM(clinfo)//' not found' ) … … 962 940 & 'with 1 or more spatial dimensions: '//cldmspc//' were found.' , & 963 941 & 'Use ncwa -a to suppress the unnecessary dimensions' ) 964 SELECT CASE (iom_file(kiomid)%iolib) 965 CASE (jpnf90 ) ; CALL iom_nf90_get( kiomid, idvar, pvar, itime ) 966 CASE DEFAULT 967 CALL ctl_stop( 'iom_g0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 968 END SELECT 942 CALL iom_nf90_get( kiomid, idvar, pvar, itime ) 969 943 ENDIF 970 944 ENDIF … … 1122 1096 IF( lrowattr .AND. idom /= jpdom_data ) CALL ctl_stop(trim(clinfo), 'lrowattr present and true needs kdom = jpdom_data') 1123 1097 IF( lrowattr .AND. idom == jpdom_data ) luse_jattr = .true. 1124 ENDIF1125 IF( luse_jattr ) THEN1126 SELECT CASE (iom_file(kiomid)%iolib)1127 CASE (jpnf90 )1128 ! Ok1129 CASE DEFAULT1130 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' )1131 END SELECT1132 1098 ENDIF 1133 1099 … … 1301 1267 ENDIF 1302 1268 1303 SELECT CASE (iom_file(kiomid)%iolib) 1304 CASE (jpnf90 ) ; CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, & 1305 & pv_r1d, pv_r2d, pv_r3d ) 1306 CASE DEFAULT 1307 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1308 END SELECT 1269 CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d ) 1309 1270 1310 1271 IF( istop == nstop ) THEN ! no additional errors until this point... … … 1422 1383 IF( iom_file(kiomid)%luld(idvar) ) THEN 1423 1384 IF( iom_file(kiomid)%dimsz(1,idvar) <= size(ptime) ) THEN 1424 SELECT CASE (iom_file(kiomid)%iolib) 1425 CASE (jpnf90 ) ; CALL iom_nf90_gettime( kiomid, idvar, ptime, cdunits, cdcalendar ) 1426 CASE DEFAULT 1427 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1428 END SELECT 1385 CALL iom_nf90_gettime( kiomid, idvar, ptime, cdunits, cdcalendar ) 1429 1386 ELSE 1430 1387 WRITE(ctmp1,*) 'error with the size of ptime ',size(ptime),iom_file(kiomid)%dimsz(1,idvar) … … 1448 1405 !! INTERFACE iom_getatt 1449 1406 !!---------------------------------------------------------------------- 1450 SUBROUTINE iom_g0d_iatt( kiomid, cdatt, pvar, cdvar )1451 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1452 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1453 INTEGER , INTENT( out) :: pvar! read field1454 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1407 SUBROUTINE iom_g0d_iatt( kiomid, cdatt, katt0d, cdvar ) 1408 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1409 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1410 INTEGER , INTENT( out) :: katt0d ! read field 1411 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1455 1412 ! 1456 1413 IF( kiomid > 0 ) THEN 1457 IF( iom_file(kiomid)%nfid > 0 ) THEN 1458 SELECT CASE (iom_file(kiomid)%iolib) 1459 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1460 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1461 ELSE 1462 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 1463 ENDIF 1464 CASE DEFAULT 1465 CALL ctl_stop( 'iom_g0d_iatt: accepted IO library is only jpnf90' ) 1466 END SELECT 1467 ENDIF 1414 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_getatt( kiomid, cdatt, katt0d = katt0d, cdvar=cdvar ) 1468 1415 ENDIF 1469 1416 END SUBROUTINE iom_g0d_iatt 1470 1417 1471 SUBROUTINE iom_g 0d_ratt( kiomid, cdatt, pvar, cdvar )1472 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1473 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1474 REAL(wp) , INTENT( out) :: pvar ! writtenfield1475 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1418 SUBROUTINE iom_g1d_iatt( kiomid, cdatt, katt1d, cdvar ) 1419 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1420 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1421 INTEGER, DIMENSION(:) , INTENT( out) :: katt1d ! read field 1422 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1476 1423 ! 1477 1424 IF( kiomid > 0 ) THEN 1478 IF( iom_file(kiomid)%nfid > 0 ) THEN 1479 SELECT CASE (iom_file(kiomid)%iolib) 1480 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1481 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1482 ELSE 1483 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 1484 ENDIF 1485 CASE DEFAULT 1486 CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 1487 END SELECT 1488 ENDIF 1425 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_getatt( kiomid, cdatt, katt1d = katt1d, cdvar=cdvar ) 1426 ENDIF 1427 END SUBROUTINE iom_g1d_iatt 1428 1429 SUBROUTINE iom_g0d_ratt( kiomid, cdatt, patt0d, cdvar ) 1430 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1431 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1432 REAL(wp) , INTENT( out) :: patt0d ! read field 1433 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1434 ! 1435 IF( kiomid > 0 ) THEN 1436 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_getatt( kiomid, cdatt, patt0d = patt0d, cdvar=cdvar ) 1489 1437 ENDIF 1490 1438 END SUBROUTINE iom_g0d_ratt 1491 1439 1492 SUBROUTINE iom_g 0d_catt( kiomid, cdatt, pvar, cdvar )1493 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1494 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1495 CHARACTER(len=*), INTENT( out) :: pvar ! writtenfield1496 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1440 SUBROUTINE iom_g1d_ratt( kiomid, cdatt, patt1d, cdvar ) 1441 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1442 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1443 REAL(wp), DIMENSION(:), INTENT( out) :: patt1d ! read field 1444 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1497 1445 ! 1498 1446 IF( kiomid > 0 ) THEN 1499 IF( iom_file(kiomid)%nfid > 0 ) THEN 1500 SELECT CASE (iom_file(kiomid)%iolib) 1501 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1502 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1503 ELSE 1504 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 1505 ENDIF 1506 CASE DEFAULT 1507 CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 1508 END SELECT 1509 ENDIF 1447 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_getatt( kiomid, cdatt, patt1d = patt1d, cdvar=cdvar ) 1448 ENDIF 1449 END SUBROUTINE iom_g1d_ratt 1450 1451 SUBROUTINE iom_g0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 1452 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1453 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1454 CHARACTER(len=*) , INTENT( out) :: cdatt0d ! read field 1455 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1456 ! 1457 IF( kiomid > 0 ) THEN 1458 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_getatt( kiomid, cdatt, cdatt0d = cdatt0d, cdvar=cdvar ) 1510 1459 ENDIF 1511 1460 END SUBROUTINE iom_g0d_catt 1461 1512 1462 1513 1463 !!---------------------------------------------------------------------- 1514 1464 !! INTERFACE iom_putatt 1515 1465 !!---------------------------------------------------------------------- 1516 SUBROUTINE iom_p0d_iatt( kiomid, cdatt, pvar, cdvar )1517 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1518 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1519 INTEGER , INTENT(in ) :: pvar ! writefield1520 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1466 SUBROUTINE iom_p0d_iatt( kiomid, cdatt, katt0d, cdvar ) 1467 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1468 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1469 INTEGER , INTENT(in ) :: katt0d ! written field 1470 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1521 1471 ! 1522 1472 IF( kiomid > 0 ) THEN 1523 IF( iom_file(kiomid)%nfid > 0 ) THEN 1524 SELECT CASE (iom_file(kiomid)%iolib) 1525 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1526 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1527 ELSE 1528 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1529 ENDIF 1530 CASE DEFAULT 1531 CALL ctl_stop( 'iom_p0d_iatt: accepted IO library is only jpnf90' ) 1532 END SELECT 1533 ENDIF 1473 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_putatt( kiomid, cdatt, katt0d = katt0d, cdvar=cdvar ) 1534 1474 ENDIF 1535 1475 END SUBROUTINE iom_p0d_iatt 1536 1476 1537 SUBROUTINE iom_p 0d_ratt( kiomid, cdatt, pvar, cdvar )1538 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1539 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1540 REAL(wp) , INTENT(in ) :: pvar ! writefield1541 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1477 SUBROUTINE iom_p1d_iatt( kiomid, cdatt, katt1d, cdvar ) 1478 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1479 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1480 INTEGER, DIMENSION(:) , INTENT(in ) :: katt1d ! written field 1481 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1542 1482 ! 1543 1483 IF( kiomid > 0 ) THEN 1544 IF( iom_file(kiomid)%nfid > 0 ) THEN 1545 SELECT CASE (iom_file(kiomid)%iolib) 1546 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1547 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1548 ELSE 1549 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1550 ENDIF 1551 CASE DEFAULT 1552 CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 1553 END SELECT 1554 ENDIF 1484 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_putatt( kiomid, cdatt, katt1d = katt1d, cdvar=cdvar ) 1485 ENDIF 1486 END SUBROUTINE iom_p1d_iatt 1487 1488 SUBROUTINE iom_p0d_ratt( kiomid, cdatt, patt0d, cdvar ) 1489 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1490 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1491 REAL(wp) , INTENT(in ) :: patt0d ! written field 1492 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1493 ! 1494 IF( kiomid > 0 ) THEN 1495 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_putatt( kiomid, cdatt, patt0d = patt0d, cdvar=cdvar ) 1555 1496 ENDIF 1556 1497 END SUBROUTINE iom_p0d_ratt 1557 1498 1558 SUBROUTINE iom_p 0d_catt( kiomid, cdatt, pvar, cdvar )1559 INTEGER , INTENT(in ):: kiomid ! Identifier of the file1560 CHARACTER(len=*) , INTENT(in ):: cdatt ! Name of the attribute1561 CHARACTER(len=*), INTENT(in ) :: pvar ! writefield1562 CHARACTER(len=*) , INTENT(in ), OPTIONAL:: cdvar ! Name of the variable1499 SUBROUTINE iom_p1d_ratt( kiomid, cdatt, patt1d, cdvar ) 1500 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1501 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1502 REAL(wp), DIMENSION(:), INTENT(in ) :: patt1d ! written field 1503 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1563 1504 ! 1564 1505 IF( kiomid > 0 ) THEN 1565 IF( iom_file(kiomid)%nfid > 0 ) THEN 1566 SELECT CASE (iom_file(kiomid)%iolib) 1567 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1568 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1569 ELSE 1570 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1571 ENDIF 1572 CASE DEFAULT 1573 CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 1574 END SELECT 1575 ENDIF 1506 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_putatt( kiomid, cdatt, patt1d = patt1d, cdvar=cdvar ) 1507 ENDIF 1508 END SUBROUTINE iom_p1d_ratt 1509 1510 SUBROUTINE iom_p0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 1511 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1512 CHARACTER(len=*) , INTENT(in ) :: cdatt ! Name of the attribute 1513 CHARACTER(len=*) , INTENT(in ) :: cdatt0d ! written field 1514 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1515 ! 1516 IF( kiomid > 0 ) THEN 1517 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_nf90_putatt( kiomid, cdatt, cdatt0d = cdatt0d, cdvar=cdvar ) 1576 1518 ENDIF 1577 1519 END SUBROUTINE iom_p0d_catt 1520 1578 1521 1579 1522 !!---------------------------------------------------------------------- … … 1604 1547 IF( iom_file(kiomid)%nfid > 0 ) THEN 1605 1548 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1606 SELECT CASE (iom_file(kiomid)%iolib) 1607 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar ) 1608 CASE DEFAULT 1609 CALL ctl_stop( 'iom_rp0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1610 END SELECT 1549 CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar ) 1611 1550 ENDIF 1612 1551 ENDIF … … 1638 1577 IF( iom_file(kiomid)%nfid > 0 ) THEN 1639 1578 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1640 SELECT CASE (iom_file(kiomid)%iolib) 1641 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar ) 1642 CASE DEFAULT 1643 CALL ctl_stop( 'iom_rp1d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1644 END SELECT 1579 CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar ) 1645 1580 ENDIF 1646 1581 ENDIF … … 1672 1607 IF( iom_file(kiomid)%nfid > 0 ) THEN 1673 1608 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1674 SELECT CASE (iom_file(kiomid)%iolib) 1675 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar ) 1676 CASE DEFAULT 1677 CALL ctl_stop( 'iom_rp2d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1678 END SELECT 1609 CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar ) 1679 1610 ENDIF 1680 1611 ENDIF … … 1706 1637 IF( iom_file(kiomid)%nfid > 0 ) THEN 1707 1638 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1708 SELECT CASE (iom_file(kiomid)%iolib) 1709 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar ) 1710 CASE DEFAULT 1711 CALL ctl_stop( 'iom_rp3d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1712 END SELECT 1639 CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar ) 1713 1640 ENDIF 1714 1641 ENDIF -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/iom_def.F90
r10068 r10380 23 23 INTEGER, PARAMETER, PUBLIC :: jpdom_autoglo_xy = 9 !: Automatically set horizontal dimensions only 24 24 INTEGER, PARAMETER, PUBLIC :: jpdom_autodta = 10 !: 25 26 INTEGER, PARAMETER, PUBLIC :: jpnf90 = 101 !: Use nf90 library27 28 INTEGER, PARAMETER, PUBLIC :: jprstlib = jpnf90 !: restarts io library29 25 30 26 INTEGER, PARAMETER, PUBLIC :: jp_r8 = 200 !: write REAL(8) … … 55 51 CHARACTER(LEN=240) :: name !: name of the file 56 52 INTEGER :: nfid !: identifier of the file (0 if closed) 57 INTEGER :: iolib !: library used to read the file (jpnf90 or new formats,58 53 !: jpioipsl option has been removed) 59 54 INTEGER :: nvars !: number of identified varibles in the file -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/iom_nf90.F90
r10377 r10380 34 34 INTERFACE iom_nf90_get 35 35 MODULE PROCEDURE iom_nf90_g0d, iom_nf90_g123d 36 END INTERFACE37 INTERFACE iom_nf90_getatt38 MODULE PROCEDURE iom_nf90_giatt, iom_nf90_gratt, iom_nf90_gcatt39 END INTERFACE40 INTERFACE iom_nf90_putatt41 MODULE PROCEDURE iom_nf90_piatt, iom_nf90_pratt, iom_nf90_pcatt42 36 END INTERFACE 43 37 INTERFACE iom_nf90_rstput … … 163 157 iom_file(kiomid)%name = TRIM(cdname) 164 158 iom_file(kiomid)%nfid = if90id 165 iom_file(kiomid)%iolib = jpnf90166 159 iom_file(kiomid)%nvars = 0 167 160 iom_file(kiomid)%irec = -1 ! useless for NetCDF files, used to know if the file is in define mode … … 327 320 END SUBROUTINE iom_nf90_g123d 328 321 329 !!---------------------------------------------------------------------- 330 !! INTERFACE iom_nf90_getatt 331 !!---------------------------------------------------------------------- 332 333 SUBROUTINE iom_nf90_giatt( kiomid, cdatt, pv_i0d, cdvar) 334 !!----------------------------------------------------------------------- 335 !! *** ROUTINE iom_nf90_giatt *** 336 !! 337 !! ** Purpose : read an integer attribute with NF90 322 323 SUBROUTINE iom_nf90_getatt( kiomid, cdatt, katt0d, katt1d, patt0d, patt1d, cdatt0d, cdvar) 324 !!----------------------------------------------------------------------- 325 !! *** ROUTINE iom_nf90_getatt *** 326 !! 327 !! ** Purpose : read an attribute with NF90 338 328 !! (either a global attribute (default) or a variable 339 329 !! attribute if optional variable name is supplied (cdvar)) 340 330 !!----------------------------------------------------------------------- 341 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 342 CHARACTER(len=*), INTENT(in ) :: cdatt ! attribute name 343 INTEGER , INTENT( out) :: pv_i0d ! read field 344 CHARACTER(len=*), INTENT(in ), OPTIONAL & 345 & :: cdvar ! name of the variable 331 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 332 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 333 INTEGER , INTENT( out), OPTIONAL :: katt0d ! read scalar integer 334 INTEGER, DIMENSION(:) , INTENT( out), OPTIONAL :: katt1d ! read 1d array integer 335 REAL(wp) , INTENT( out), OPTIONAL :: patt0d ! read scalar real 336 REAL(wp), DIMENSION(:), INTENT( out), OPTIONAL :: patt1d ! read 1d array real 337 CHARACTER(len=*) , INTENT( out), OPTIONAL :: cdatt0d ! read character 338 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! name of the variable 346 339 ! 347 340 INTEGER :: if90id ! temporary integer … … 359 352 llok = NF90_Inquire_attribute(if90id, ivarid, cdatt) == nf90_noerr 360 353 ELSE 361 CALL ctl_warn('iom_nf90_getatt: no variable '// cdvar//' found')354 CALL ctl_warn('iom_nf90_getatt: no variable '//TRIM(cdvar)//' found') 362 355 ENDIF 363 356 ELSE … … 367 360 ! 368 361 IF( llok) THEN 369 clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', giatt: '//TRIM(cdatt) 370 CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values=pv_i0d), clinfo) 362 clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', att: '//TRIM(cdatt) 363 IF(PRESENT( katt0d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = katt0d), clinfo) 364 IF(PRESENT( katt1d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = katt1d), clinfo) 365 IF(PRESENT( patt0d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = patt0d), clinfo) 366 IF(PRESENT( patt1d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = patt1d), clinfo) 367 IF(PRESENT(cdatt0d)) CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values = cdatt0d), clinfo) 371 368 ELSE 372 CALL ctl_warn('iom_nf90_getatt: no attribute '//cdatt//' found') 373 pv_i0d = -999 374 ENDIF 375 ! 376 END SUBROUTINE iom_nf90_giatt 377 378 379 SUBROUTINE iom_nf90_gratt( kiomid, cdatt, pv_r0d, cdvar ) 380 !!----------------------------------------------------------------------- 381 !! *** ROUTINE iom_nf90_gratt *** 382 !! 383 !! ** Purpose : read a real attribute with NF90 369 CALL ctl_warn('iom_nf90_getatt: no attribute '//TRIM(cdatt)//' found') 370 IF(PRESENT( katt0d)) katt0d = -999 371 IF(PRESENT( katt1d)) katt1d(:) = -999 372 IF(PRESENT( patt0d)) patt0d = -999._wp 373 IF(PRESENT( patt1d)) patt1d(:) = -999._wp 374 IF(PRESENT(cdatt0d)) cdatt0d = '!' 375 ENDIF 376 ! 377 END SUBROUTINE iom_nf90_getatt 378 379 380 SUBROUTINE iom_nf90_putatt( kiomid, cdatt, katt0d, katt1d, patt0d, patt1d, cdatt0d, cdvar) 381 !!----------------------------------------------------------------------- 382 !! *** ROUTINE iom_nf90_putatt *** 383 !! 384 !! ** Purpose : write an attribute with NF90 384 385 !! (either a global attribute (default) or a variable 385 386 !! attribute if optional variable name is supplied (cdvar)) 386 387 !!----------------------------------------------------------------------- 387 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 388 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 389 REAL(wp) , INTENT( out) :: pv_r0d ! read field 390 CHARACTER(len=*), OPTIONAL, INTENT(in ) :: cdvar ! name of the variable 391 ! 392 INTEGER :: if90id ! temporary integer 393 INTEGER :: ivarid ! NetCDF variable Id 394 LOGICAL :: llok ! temporary logical 395 CHARACTER(LEN=100) :: clinfo ! info character 396 !--------------------------------------------------------------------- 397 ! 398 if90id = iom_file(kiomid)%nfid 399 IF( PRESENT(cdvar) ) THEN 400 ! check the variable exists in the file 401 llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr 402 IF( llok ) THEN 403 ! check the variable has the attribute required 404 llok = NF90_Inquire_attribute(if90id, ivarid, cdatt) == nf90_noerr 405 ELSE 406 CALL ctl_warn('iom_nf90_getatt: no variable '//cdvar//' found') 407 ENDIF 408 ELSE 409 llok = NF90_Inquire_attribute(if90id, NF90_GLOBAL, cdatt) == nf90_noerr 410 ivarid = NF90_GLOBAL 411 ENDIF 412 ! 413 IF( llok) THEN 414 clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', gratt: '//TRIM(cdatt) 415 CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values=pv_r0d), clinfo) 416 ELSE 417 CALL ctl_warn('iom_nf90_getatt: no attribute '//cdatt//' found') 418 pv_r0d = -999._wp 419 ENDIF 420 ! 421 END SUBROUTINE iom_nf90_gratt 422 423 424 SUBROUTINE iom_nf90_gcatt( kiomid, cdatt, pv_c0d, cdvar ) 425 !!----------------------------------------------------------------------- 426 !! *** ROUTINE iom_nf90_gcatt *** 427 !! 428 !! ** Purpose : read a character attribute with NF90 429 !! (either a global attribute (default) or a variable 430 !! attribute if optional variable name is supplied (cdvar)) 431 !!----------------------------------------------------------------------- 432 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 433 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 434 CHARACTER(len=*) , INTENT( out) :: pv_c0d ! read field 435 CHARACTER(len=*), OPTIONAL, INTENT(in ) :: cdvar ! name of the variable 436 ! 437 INTEGER :: if90id ! temporary integer 438 INTEGER :: ivarid ! NetCDF variable Id 439 LOGICAL :: llok ! temporary logical 440 CHARACTER(LEN=100) :: clinfo ! info character 441 !--------------------------------------------------------------------- 442 ! 443 if90id = iom_file(kiomid)%nfid 444 IF( PRESENT(cdvar) ) THEN 445 ! check the variable exists in the file 446 llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr 447 IF( llok ) THEN 448 ! check the variable has the attribute required 449 llok = NF90_Inquire_attribute(if90id, ivarid, cdatt) == nf90_noerr 450 ELSE 451 CALL ctl_warn('iom_nf90_getatt: no variable '//cdvar//' found') 452 ENDIF 453 ELSE 454 llok = NF90_Inquire_attribute(if90id, NF90_GLOBAL, cdatt) == nf90_noerr 455 ivarid = NF90_GLOBAL 456 ENDIF 457 ! 458 IF( llok) THEN 459 clinfo = 'iom_nf90_getatt, file: '//TRIM(iom_file(kiomid)%name)//', gcatt: '//TRIM(cdatt) 460 CALL iom_nf90_check(NF90_GET_ATT(if90id, ivarid, cdatt, values=pv_c0d), clinfo) 461 ELSE 462 CALL ctl_warn('iom_nf90_getatt: no attribute '//cdatt//' found') 463 pv_c0d = '!' 464 ENDIF 465 ! 466 END SUBROUTINE iom_nf90_gcatt 467 468 469 !!---------------------------------------------------------------------- 470 !! INTERFACE iom_nf90_putatt 471 !!---------------------------------------------------------------------- 472 473 SUBROUTINE iom_nf90_piatt( kiomid, cdatt, pv_i0d, cdvar) 474 !!----------------------------------------------------------------------- 475 !! *** ROUTINE iom_nf90_piatt *** 476 !! 477 !! ** Purpose : write an integer attribute with NF90 478 !! (either a global attribute (default) or a variable 479 !! attribute if optional variable name is supplied (cdvar)) 480 !!----------------------------------------------------------------------- 481 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 482 CHARACTER(len=*), INTENT(in ) :: cdatt ! attribute name 483 INTEGER , INTENT(in ) :: pv_i0d ! write field 484 CHARACTER(len=*), INTENT(in ), OPTIONAL & 485 & :: cdvar ! name of the variable 388 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 389 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 390 INTEGER , INTENT(in ), OPTIONAL :: katt0d ! read scalar integer 391 INTEGER, DIMENSION(:) , INTENT(in ), OPTIONAL :: katt1d ! read 1d array integer 392 REAL(wp) , INTENT(in ), OPTIONAL :: patt0d ! read scalar real 393 REAL(wp), DIMENSION(:), INTENT(in ), OPTIONAL :: patt1d ! read 1d array real 394 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdatt0d ! read character 395 CHARACTER(len=*) , INTENT(in ), OPTIONAL :: cdvar ! name of the variable 486 396 ! 487 397 INTEGER :: if90id ! temporary integer … … 498 408 llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr 499 409 IF( .NOT. llok ) THEN 500 CALL ctl_warn('iom_nf90_putatt: no variable '// cdvar//' found')410 CALL ctl_warn('iom_nf90_putatt: no variable '//TRIM(cdvar)//' found') 501 411 ENDIF 502 412 ELSE … … 506 416 ! 507 417 IF( llok) THEN 508 clinfo = 'iom_nf90_putatt, file: '//TRIM(iom_file(kiomid)%name)//', piatt: '//TRIM(cdatt)418 clinfo = 'iom_nf90_putatt, file: '//TRIM(iom_file(kiomid)%name)//', att: '//TRIM(cdatt) 509 419 IF( iom_file(kiomid)%irec /= -1 ) THEN 510 420 ! trick: irec used to know if the file is in define mode or not … … 514 424 ENDIF 515 425 ! 516 CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values=pv_i0d), clinfo) 426 IF(PRESENT( katt0d)) CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values = katt0d), clinfo) 427 IF(PRESENT( katt1d)) CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values = katt1d), clinfo) 428 IF(PRESENT( patt0d)) CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values = patt0d), clinfo) 429 IF(PRESENT( patt1d)) CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values = patt1d), clinfo) 430 IF(PRESENT(cdatt0d)) CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values = cdatt0d), clinfo) 517 431 ! 518 IF( lenddef ) THEN 519 ! file was in data mode on entry; put it back in that mode 432 IF( lenddef ) THEN ! file was in data mode on entry; put it back in that mode 520 433 CALL iom_nf90_check(NF90_ENDDEF( if90id ), clinfo) 521 434 ENDIF 522 435 ELSE 523 CALL ctl_warn('iom_nf90_putatt: no attribute '//cdatt//' written') 524 ENDIF 525 ! 526 END SUBROUTINE iom_nf90_piatt 527 528 529 SUBROUTINE iom_nf90_pratt( kiomid, cdatt, pv_r0d, cdvar ) 530 !!----------------------------------------------------------------------- 531 !! *** ROUTINE iom_nf90_pratt *** 532 !! 533 !! ** Purpose : write a real attribute with NF90 534 !! (either a global attribute (default) or a variable 535 !! attribute if optional variable name is supplied (cdvar)) 536 !!----------------------------------------------------------------------- 537 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 538 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 539 REAL(wp) , INTENT(in ) :: pv_r0d ! write field 540 CHARACTER(len=*), OPTIONAL, INTENT(in ) :: cdvar ! name of the variable 541 ! 542 INTEGER :: if90id ! temporary integer 543 INTEGER :: ivarid ! NetCDF variable Id 544 LOGICAL :: llok ! temporary logical 545 LOGICAL :: lenddef ! temporary logical 546 CHARACTER(LEN=100) :: clinfo ! info character 547 !--------------------------------------------------------------------- 548 ! 549 if90id = iom_file(kiomid)%nfid 550 lenddef = .false. 551 IF( PRESENT(cdvar) ) THEN 552 ! check the variable exists in the file 553 llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr 554 IF( .NOT. llok ) THEN 555 CALL ctl_warn('iom_nf90_putatt: no variable '//cdvar//' found') 556 ENDIF 557 ELSE 558 llok = .true. 559 ivarid = NF90_GLOBAL 560 ENDIF 561 ! 562 IF( llok) THEN 563 clinfo = 'iom_nf90_putatt, file: '//TRIM(iom_file(kiomid)%name)//', pratt: '//TRIM(cdatt) 564 IF( iom_file(kiomid)%irec /= -1 ) THEN 565 ! trick: irec used to know if the file is in define mode or not 566 ! if it is not then temporarily put it into define mode 567 CALL iom_nf90_check(NF90_REDEF( if90id ), clinfo) 568 lenddef = .true. 569 ENDIF 570 ! 571 CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values=pv_r0d), clinfo) 572 ! 573 IF( lenddef ) THEN 574 ! file was in data mode on entry; put it back in that mode 575 CALL iom_nf90_check(NF90_ENDDEF( if90id ), clinfo) 576 ENDIF 577 ELSE 578 CALL ctl_warn('iom_nf90_putatt: no attribute '//cdatt//' written') 579 ENDIF 580 ! 581 END SUBROUTINE iom_nf90_pratt 582 583 584 SUBROUTINE iom_nf90_pcatt( kiomid, cdatt, pv_c0d, cdvar ) 585 !!----------------------------------------------------------------------- 586 !! *** ROUTINE iom_nf90_pcatt *** 587 !! 588 !! ** Purpose : write a character attribute with NF90 589 !! (either a global attribute (default) or a variable 590 !! attribute if optional variable name is supplied (cdvar)) 591 !!----------------------------------------------------------------------- 592 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 593 CHARACTER(len=*) , INTENT(in ) :: cdatt ! attribute name 594 CHARACTER(len=*) , INTENT(in ) :: pv_c0d ! write field 595 CHARACTER(len=*), OPTIONAL, INTENT(in ) :: cdvar ! name of the variable 596 ! 597 INTEGER :: if90id ! temporary integer 598 INTEGER :: ivarid ! NetCDF variable Id 599 LOGICAL :: llok ! temporary logical 600 LOGICAL :: lenddef ! temporary logical 601 CHARACTER(LEN=100) :: clinfo ! info character 602 !--------------------------------------------------------------------- 603 ! 604 if90id = iom_file(kiomid)%nfid 605 lenddef = .false. 606 IF( PRESENT(cdvar) ) THEN 607 ! check the variable exists in the file 608 llok = NF90_INQ_VARID( if90id, TRIM(cdvar), ivarid ) == nf90_noerr 609 IF( .NOT. llok ) THEN 610 CALL ctl_warn('iom_nf90_putatt: no variable '//cdvar//' found') 611 ENDIF 612 ELSE 613 llok = .true. 614 ivarid = NF90_GLOBAL 615 ENDIF 616 ! 617 IF( llok) THEN 618 clinfo = 'iom_nf90_putatt, file: '//TRIM(iom_file(kiomid)%name)//', pcatt: '//TRIM(cdatt) 619 IF( iom_file(kiomid)%irec /= -1 ) THEN 620 ! trick: irec used to know if the file is in define mode or not 621 ! if it is not then temporarily put it into define mode 622 CALL iom_nf90_check(NF90_REDEF( if90id ), clinfo) 623 lenddef = .true. 624 ENDIF 625 ! 626 CALL iom_nf90_check(NF90_PUT_ATT(if90id, ivarid, cdatt, values=pv_c0d), clinfo) 627 ! 628 IF( lenddef ) THEN 629 ! file was in data mode on entry; put it back in that mode 630 CALL iom_nf90_check(NF90_ENDDEF( if90id ), clinfo) 631 ENDIF 632 ELSE 633 CALL ctl_warn('iom_nf90_putatt: no attribute '//cdatt//' written') 634 ENDIF 635 ! 636 END SUBROUTINE iom_nf90_pcatt 436 CALL ctl_warn('iom_nf90_putatt: no attribute '//TRIM(cdatt)//' written') 437 ENDIF 438 ! 439 END SUBROUTINE iom_nf90_putatt 637 440 638 441 -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/restart.F90
r10359 r10380 97 97 WRITE(numout,*) 98 98 IF(.NOT.lwxios) THEN 99 SELECT CASE ( jprstlib ) 100 CASE DEFAULT ; WRITE(numout,*) & 101 ' open ocean restart NetCDF file: ',TRIM(clpath)//TRIM(clname) 102 END SELECT 99 WRITE(numout,*) ' open ocean restart NetCDF file: ',TRIM(clpath)//TRIM(clname) 103 100 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 104 101 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt … … 109 106 ! 110 107 IF(.NOT.lwxios) THEN 111 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE. , kiolib = jprstlib)108 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE. ) 112 109 ELSE 113 110 #if defined key_iomput … … 137 134 !! *** ROUTINE rstwrite *** 138 135 !! 139 !! ** Purpose : Write restart fields in the format corresponding to jprstlib136 !! ** Purpose : Write restart fields in NetCDF format 140 137 !! 141 138 !! ** Method : Write in numrow when kt == nitrst in NetCDF … … 201 198 !! *** ROUTINE rst_read_open *** 202 199 !! 203 !! ** Purpose : Open read files for restart (format fixed by jprstlib )200 !! ** Purpose : Open read files for NetCDF restart 204 201 !! 205 202 !! ** Method : Use a non-zero, positive value of numror to assess whether or not 206 203 !! the file has already been opened 207 204 !!---------------------------------------------------------------------- 208 INTEGER :: jlibalt = jprstlib209 205 LOGICAL :: llok 210 206 CHARACTER(lc) :: clpath ! full path to ocean output restart file … … 214 210 IF(lwp) THEN ! Contol prints 215 211 WRITE(numout,*) 216 SELECT CASE ( jprstlib ) 217 CASE ( jpnf90 ) ; WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 218 END SELECT 212 WRITE(numout,*) 'rst_read : read oce NetCDF restart file' 219 213 IF ( snc4set%luse ) WRITE(numout,*) 'rst_read : configured with NetCDF4 support' 220 214 WRITE(numout,*) '~~~~~~~~' … … 223 217 clpath = TRIM(cn_ocerst_indir) 224 218 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 225 CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror , kiolib = jlibalt)219 CALL iom_open( TRIM(clpath)//cn_ocerst_in, numror ) 226 220 ! are we using XIOS to read the data? Part above will have to modified once XIOS 227 221 ! can handle checking if variable is in the restart file (there will be no need to open … … 250 244 !! *** ROUTINE rst_read *** 251 245 !! 252 !! ** Purpose : Read files for restart (format fixed by jprstlib )246 !! ** Purpose : Read files for NetCDF restart 253 247 !! 254 248 !! ** Method : Read in restart.nc file fields which are necessary for restart -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/SBC/sbcrnf.F90
r10297 r10380 423 423 IF( nn_rnf_depth_file == 1 ) THEN ! save output nb levels for runoff 424 424 IF(lwp) WRITE(numout,*) ' ==>>> create runoff depht file' 425 CALL iom_open ( TRIM( sn_dep_rnf%clname ), inum, ldwrt = .TRUE. , kiolib = jprstlib)425 CALL iom_open ( TRIM( sn_dep_rnf%clname ), inum, ldwrt = .TRUE. ) 426 426 CALL iom_rstput( 0, 0, inum, 'rodepth', h_rnf ) 427 427 CALL iom_close ( inum ) -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/STO/stopar.F90
r10170 r10380 701 701 702 702 ! Open the restart file 703 CALL iom_open( cn_storst_in, numstor , kiolib = jprstlib)703 CALL iom_open( cn_storst_in, numstor ) 704 704 705 705 ! Get stochastic parameters from restart file: … … 806 806 ENDIF 807 807 ! open the restart file 808 CALL iom_open( clname, numstow, ldwrt = .TRUE. , kiolib = jprstlib)808 CALL iom_open( clname, numstow, ldwrt = .TRUE. ) 809 809 ENDIF 810 810 ENDIF -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/TRD/trdmxl_rst.F90
r10068 r10380 61 61 IF(lwp) THEN 62 62 WRITE(numout,*) 63 SELECT CASE ( jprstlib ) 64 CASE DEFAULT ; WRITE(numout,*) ' open ocean restart_mxl NetCDF file: '//clname 65 END SELECT 63 WRITE(numout,*) ' open ocean restart_mxl NetCDF file: '//clname 66 64 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt,' date= ', ndastp 67 65 ELSE ; WRITE(numout,*) ' kt = ' , kt,' date= ', ndastp … … 69 67 ENDIF 70 68 71 CALL iom_open( TRIM(clpath)//TRIM(clname), nummxlw, ldwrt = .TRUE. , kiolib = jprstlib)69 CALL iom_open( TRIM(clpath)//TRIM(clname), nummxlw, ldwrt = .TRUE. ) 72 70 ENDIF 73 71 … … 133 131 CHARACTER (len=35) :: charout 134 132 INTEGER :: jk ! loop indice 135 INTEGER :: jlibalt = jprstlib136 133 LOGICAL :: llok 137 134 CHARACTER(LEN=256) :: clpath ! full path to restart file … … 146 143 clpath = TRIM(cn_ocerst_indir) 147 144 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 148 CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_in), inum , kiolib = jlibalt)145 CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_in), inum ) 149 146 150 147 IF( ln_trdmxl_instant ) THEN -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/SAS/diawri.F90
r10358 r10380 354 354 355 355 #if defined key_si3 356 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., k iolib = jprstlib, kdlev = jpl )356 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE., kdlev = jpl ) 357 357 #else 358 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. , kiolib = jprstlib)358 CALL iom_open( TRIM(cdfile_name), inum, ldwrt = .TRUE. ) 359 359 #endif 360 360 -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/PISCES/SED/sedrst.F90
r10345 r10380 78 78 IF(lwp) WRITE(numsed,*) & 79 79 ' open sed restart.output NetCDF file: ',TRIM(clpath)//clname 80 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., k iolib = jprstlib, kdlev = jpksed )80 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed ) 81 81 lrst_sed = .TRUE. 82 82 ENDIF … … 105 105 CHARACTER(len = 20) :: cltra 106 106 CHARACTER(LEN=20) :: name1 107 INTEGER :: jlibalt = jprstlib108 107 LOGICAL :: llok 109 108 !-------------------------------------------------------------------- … … 338 337 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag 339 338 ! 340 INTEGER :: jlibalt = jprstlib341 339 LOGICAL :: llok 342 340 REAL(wp) :: zkt, zrdttrc1 … … 353 351 354 352 IF( ln_rst_sed ) THEN 355 CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr , kiolib = jlibalt)353 CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr ) 356 354 CALL iom_get ( numrsr, 'kt', zkt ) ! last time-step of previous run 357 355 -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/TRP/trdmxl_trc_rst.F90
r10068 r10380 54 54 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 55 55 IF(lwp) WRITE(numout,*) ' open ocean restart_mld_trc NetCDF 'TRIM(clpath)//TRIM(clname) 56 CALL iom_open( TRIM(clpath)//TRIM(clname), nummldw_trc, ldwrt = .TRUE. , kiolib = jprstlib)56 CALL iom_open( TRIM(clpath)//TRIM(clname), nummldw_trc, ldwrt = .TRUE. ) 57 57 ENDIF 58 58 … … 127 127 CHARACTER (len=35) :: charout 128 128 INTEGER :: jk, jn, jl ! loop indice 129 INTEGER :: jlibalt = jprstlib130 129 LOGICAL :: llok 131 130 CHARACTER(LEN=256) :: clpath ! full path to restart file … … 140 139 clpath = TRIM(cn_trcrst_indir) 141 140 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 142 CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_trc_in), inum , kiolib = jlibalt)141 CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_trc_in), inum ) 143 142 144 143 IF( ln_trdmxl_trc_instant ) THEN -
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/TOP/trcrst.F90
r10345 r10380 87 87 IF(lwp) WRITE(numout,*) & 88 88 ' open trc restart.output NetCDF file: ',TRIM(clpath)//clname 89 CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. , kiolib = jprstlib)89 CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. ) 90 90 lrst_trc = .TRUE. 91 91 ENDIF … … 184 184 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag 185 185 ! 186 INTEGER :: jlibalt = jprstlib187 186 LOGICAL :: llok 188 187 REAL(wp) :: zrdttrc1, zkt, zndastp, zdayfrac, ksecs, ktime … … 199 198 200 199 IF( ln_rsttr ) THEN 201 CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr , kiolib = jlibalt)200 CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr ) 202 201 CALL iom_get ( numrtr, 'kt', zkt ) ! last time-step of previous run 203 202
Note: See TracChangeset
for help on using the changeset viewer.