- Timestamp:
- 2016-11-28T17:04:10+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r5836 r7351 8 8 !! 3.0 ! 2007-07 (D. Storkey) Changes to iom_gettime 9 9 !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) add C1D case 10 !! 3.6 ! 2014-15 DIMG format removed 10 11 !!-------------------------------------------------------------------- 11 12 … … 23 24 USE lbclnk ! lateal boundary condition / mpp exchanges 24 25 USE iom_def ! iom variables definitions 25 USE iom_ioipsl ! NetCDF format with IOIPSL library26 26 USE iom_nf90 ! NetCDF format with native NetCDF library 27 USE iom_rstdimg ! restarts access direct format "dimg" style...28 27 USE in_out_manager ! I/O manager 29 28 USE lib_mpp ! MPP library … … 115 114 CASE (30) ; CALL xios_set_context_attr(TRIM(clname), calendar_type= "D360") 116 115 END SELECT 117 WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' 00:00:00')") nyear,nmonth,nday116 WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' ',i2.2,':',i2.2,':00')") nyear,nmonth,nday,nhour,nminute 118 117 CALL xios_set_context_attr(TRIM(clname), start_date=cldate ) 119 118 … … 246 245 CHARACTER(LEN=256) :: clname ! the name of the file based on cdname [[+clcpu]+clcpu] 247 246 CHARACTER(LEN=256) :: cltmpn ! tempory name to store clname (in writting mode) 248 CHARACTER(LEN=10) :: clsuffix ! ".nc" or ".dimg"247 CHARACTER(LEN=10) :: clsuffix ! ".nc" 249 248 CHARACTER(LEN=15) :: clcpu ! the cpu number (max jpmax_digits digits) 250 249 CHARACTER(LEN=256) :: clinfo ! info character … … 309 308 ! which suffix should we use? 310 309 SELECT CASE (iolib) 311 CASE (jpioipsl ) ; clsuffix = '.nc'312 310 CASE (jpnf90 ) ; clsuffix = '.nc' 313 CASE (jprstdimg) ; clsuffix = '.dimg'314 311 CASE DEFAULT ; clsuffix = '' 315 CALL ctl_stop( TRIM(clinfo), 'accepted IO library are only jpioipsl, jpnf90 and jprstdimg' )312 CALL ctl_stop( TRIM(clinfo), 'accepted IO library is only jpnf90 (jpioipsl option has been removed) ' ) 316 313 END SELECT 317 314 ! Add the suffix if needed … … 326 323 IF( .NOT.llok ) THEN 327 324 ! we try to add the cpu number to the name 328 IF( iolib == jprstdimg ) THEN ; WRITE(clcpu,*) narea 329 ELSE ; WRITE(clcpu,*) narea-1 330 ENDIF 325 WRITE(clcpu,*) narea-1 326 331 327 clcpu = TRIM(ADJUSTL(clcpu)) 332 328 iln = INDEX(clname,TRIM(clsuffix), back = .TRUE.) … … 375 371 END SELECT 376 372 ENDIF 377 ! Open the NetCDF or RSTDIMGfile373 ! Open the NetCDF file 378 374 ! ============= 379 375 ! do we have some free file identifier? … … 399 395 IF( istop == nstop ) THEN ! no error within this routine 400 396 SELECT CASE (iolib) 401 CASE (jpioipsl ) ; CALL iom_ioipsl_open( clname, kiomid, llwrt, llok, idompar )402 397 CASE (jpnf90 ) ; CALL iom_nf90_open( clname, kiomid, llwrt, llok, idompar ) 403 CASE (jprstdimg) ; CALL iom_rstdimg_open( clname, kiomid, llwrt, llok, idompar )404 398 CASE DEFAULT 405 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' )399 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed) ' ) 406 400 END SELECT 407 401 ENDIF … … 438 432 IF( iom_file(jf)%nfid > 0 ) THEN 439 433 SELECT CASE (iom_file(jf)%iolib) 440 CASE (jpioipsl ) ; CALL iom_ioipsl_close( jf )441 434 CASE (jpnf90 ) ; CALL iom_nf90_close( jf ) 442 CASE (jprstdimg) ; CALL iom_rstdimg_close( jf )443 435 CASE DEFAULT 444 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' )436 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 445 437 END SELECT 446 438 iom_file(jf)%nfid = 0 ! free the id … … 497 489 IF( iiv <= jpmax_vars ) THEN 498 490 SELECT CASE (iom_file(kiomid)%iolib) 499 CASE (jpioipsl ) ; iom_varid = iom_ioipsl_varid( kiomid, cdvar, iiv, kdimsz )500 491 CASE (jpnf90 ) ; iom_varid = iom_nf90_varid ( kiomid, cdvar, iiv, kdimsz, kndims ) 501 CASE (jprstdimg) ; iom_varid = -1 ! all variables are listed in iom_file 502 CASE DEFAULT 503 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 492 CASE DEFAULT 493 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 504 494 END SELECT 505 495 ELSE … … 559 549 & 'Use ncwa -a to suppress the unnecessary dimensions' ) 560 550 SELECT CASE (iom_file(kiomid)%iolib) 561 CASE (jpioipsl ) ; CALL iom_ioipsl_get( kiomid, idvar, pvar, itime )562 551 CASE (jpnf90 ) ; CALL iom_nf90_get( kiomid, idvar, pvar, itime ) 563 CASE (jprstdimg) ; CALL iom_rstdimg_get( kiomid, idvar, pvar ) 564 CASE DEFAULT 565 CALL ctl_stop( 'iom_g0d: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 552 CASE DEFAULT 553 CALL ctl_stop( 'iom_g0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 566 554 END SELECT 567 555 ENDIF … … 673 661 CHARACTER(LEN=256) :: clname ! file name 674 662 CHARACTER(LEN=1) :: clrankpv, cldmspc ! 663 LOGICAL :: ll_depth_spec ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension. 675 664 !--------------------------------------------------------------------- 676 665 ! … … 685 674 IF( PRESENT(kcount) .AND. (.NOT. PRESENT(kstart)) ) CALL ctl_stop(trim(clinfo), 'kcount present needs kstart present') 686 675 IF( PRESENT(kstart) .AND. (.NOT. PRESENT(kcount)) ) CALL ctl_stop(trim(clinfo), 'kstart present needs kcount present') 687 IF( PRESENT(kstart) .AND. idom /= jpdom_unknown ) CALL ctl_stop(trim(clinfo), 'kstart present needs kdom = jpdom_unknown') 676 IF( PRESENT(kstart) .AND. idom /= jpdom_unknown .AND. idom /= jpdom_autoglo_xy ) & 677 & CALL ctl_stop(trim(clinfo), 'kstart present needs kdom = jpdom_unknown or kdom = jpdom_autoglo_xy') 688 678 689 679 luse_jattr = .false. … … 694 684 IF( luse_jattr ) THEN 695 685 SELECT CASE (iom_file(kiomid)%iolib) 696 CASE (jpioipsl, jprstdimg )697 CALL ctl_warn(trim(clinfo), 'lrowattr present and true but this only works with netcdf (jpnf90)')698 luse_jattr = .false.699 686 CASE (jpnf90 ) 700 687 ! Ok 701 688 CASE DEFAULT 702 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' )689 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 703 690 END SELECT 704 691 ENDIF … … 718 705 ! update idom definition... 719 706 ! Identify the domain in case of jpdom_auto(glo/dta) definition 707 IF( idom == jpdom_autoglo_xy ) THEN 708 ll_depth_spec = .TRUE. 709 idom = jpdom_autoglo 710 ELSE 711 ll_depth_spec = .FALSE. 712 ENDIF 720 713 IF( idom == jpdom_autoglo .OR. idom == jpdom_autodta ) THEN 721 714 IF( idom == jpdom_autoglo ) THEN ; idom = jpdom_global … … 771 764 istart(idmspc+1) = itime 772 765 773 IF( PRESENT(kstart)) THEN ; istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc)766 IF( PRESENT(kstart) .AND. .NOT. ll_depth_spec ) THEN ; istart(1:idmspc) = kstart(1:idmspc) ; icnt(1:idmspc) = kcount(1:idmspc) 774 767 ELSE 775 IF( idom == jpdom_unknown ) THEN ; icnt(1:idmspc) = idimsz(1:idmspc)768 IF( idom == jpdom_unknown ) THEN ; icnt(1:idmspc) = idimsz(1:idmspc) 776 769 ELSE 777 770 IF( .NOT. PRESENT(pv_r1d) ) THEN ! not a 1D array … … 796 789 ENDIF 797 790 IF( PRESENT(pv_r3d) ) THEN 798 IF( idom == jpdom_data ) THEN ; icnt(3) = jpkdta 799 ELSE ; icnt(3) = jpk 791 IF( idom == jpdom_data ) THEN ; icnt(3) = jpkdta 792 ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN ; istart(3) = kstart(3); icnt(3) = kcount(3) 793 ELSE ; icnt(3) = jpk 800 794 ENDIF 801 795 ENDIF … … 866 860 867 861 SELECT CASE (iom_file(kiomid)%iolib) 868 CASE (jpioipsl ) ; CALL iom_ioipsl_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, &869 & pv_r1d, pv_r2d, pv_r3d )870 862 CASE (jpnf90 ) ; CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, & 871 863 & pv_r1d, pv_r2d, pv_r3d ) 872 CASE (jprstdimg) ; CALL iom_rstdimg_get( kiomid, idom, idvar, ix1, ix2, iy1, iy2, & 873 & pv_r1d, pv_r2d, pv_r3d ) 874 CASE DEFAULT 875 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 864 CASE DEFAULT 865 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 876 866 END SELECT 877 867 … … 956 946 IF( iom_file(kiomid)%dimsz(1,idvar) <= size(ptime) ) THEN 957 947 SELECT CASE (iom_file(kiomid)%iolib) 958 CASE (jpioipsl ) ; CALL iom_ioipsl_gettime( kiomid, idvar, ptime, cdunits, cdcalendar )959 948 CASE (jpnf90 ) ; CALL iom_nf90_gettime( kiomid, idvar, ptime, cdunits, cdcalendar ) 960 CASE (jprstdimg) ; CALL ctl_stop( TRIM(clinfo)//' case IO library == jprstdimg not coded...' ) 961 CASE DEFAULT 962 CALL ctl_stop( TRIM(clinfo)//' accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 949 CASE DEFAULT 950 CALL ctl_stop( TRIM(clinfo)//' accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 963 951 END SELECT 964 952 ELSE … … 991 979 IF( iom_file(kiomid)%nfid > 0 ) THEN 992 980 SELECT CASE (iom_file(kiomid)%iolib) 993 CASE (jpioipsl ) ; CALL ctl_stop('iom_getatt: only nf90 available')994 981 CASE (jpnf90 ) ; CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 995 CASE (jprstdimg) ; CALL ctl_stop('iom_getatt: only nf90 available') 996 CASE DEFAULT 997 CALL ctl_stop( 'iom_g0d_att: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 982 CASE DEFAULT 983 CALL ctl_stop( 'iom_g0d_att: accepted IO library is only jpnf90' ) 998 984 END SELECT 999 985 ENDIF … … 1017 1003 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1018 1004 SELECT CASE (iom_file(kiomid)%iolib) 1019 CASE (jpioipsl ) ; CALL iom_ioipsl_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar )1020 1005 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar ) 1021 CASE (jprstdimg) ; IF( kt == kwrite ) CALL iom_rstdimg_rstput( kiomid, cdvar, ivid, pvar ) 1022 CASE DEFAULT 1023 CALL ctl_stop( 'iom_rp0d: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 1006 CASE DEFAULT 1007 CALL ctl_stop( 'iom_rp0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1024 1008 END SELECT 1025 1009 ENDIF … … 1039 1023 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1040 1024 SELECT CASE (iom_file(kiomid)%iolib) 1041 CASE (jpioipsl ) ; CALL iom_ioipsl_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar )1042 1025 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar ) 1043 CASE (jprstdimg) ; IF( kt == kwrite ) CALL iom_rstdimg_rstput( kiomid, cdvar, ivid, pv_r1d = pvar ) 1044 CASE DEFAULT 1045 CALL ctl_stop( 'iom_rp1d: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 1026 CASE DEFAULT 1027 CALL ctl_stop( 'iom_rp1d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1046 1028 END SELECT 1047 1029 ENDIF … … 1061 1043 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1062 1044 SELECT CASE (iom_file(kiomid)%iolib) 1063 CASE (jpioipsl ) ; CALL iom_ioipsl_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar )1064 1045 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar ) 1065 CASE (jprstdimg) ; IF( kt == kwrite ) CALL iom_rstdimg_rstput( kiomid, cdvar, ivid, pv_r2d = pvar ) 1066 CASE DEFAULT 1067 CALL ctl_stop( 'iom_rp2d: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 1046 CASE DEFAULT 1047 CALL ctl_stop( 'iom_rp2d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1068 1048 END SELECT 1069 1049 ENDIF … … 1083 1063 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1084 1064 SELECT CASE (iom_file(kiomid)%iolib) 1085 CASE (jpioipsl ) ; CALL iom_ioipsl_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar )1086 1065 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar ) 1087 CASE (jprstdimg) ; IF( kt == kwrite ) CALL iom_rstdimg_rstput( kiomid, cdvar, ivid, pv_r3d = pvar ) 1088 CASE DEFAULT 1089 CALL ctl_stop( 'iom_rp3d: accepted IO library are only jpioipsl and jprstdimg' ) 1066 CASE DEFAULT 1067 CALL ctl_stop( 'iom_rp3d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1090 1068 END SELECT 1091 1069 ENDIF … … 1645 1623 idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 1646 1624 DO WHILE ( idx /= 0 ) 1647 cldate = iom_sdate( fjulday - rdt tra(1)/ rday )1625 cldate = iom_sdate( fjulday - rdt / rday ) 1648 1626 clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname)) 1649 1627 idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') … … 1652 1630 idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') 1653 1631 DO WHILE ( idx /= 0 ) 1654 cldate = iom_sdate( fjulday - rdt tra(1)/ rday, ldfull = .TRUE. )1632 cldate = iom_sdate( fjulday - rdt / rday, ldfull = .TRUE. ) 1655 1633 clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname)) 1656 1634 idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') … … 1659 1637 idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') 1660 1638 DO WHILE ( idx /= 0 ) 1661 cldate = iom_sdate( fjulday + rdt tra(1)/ rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. )1639 cldate = iom_sdate( fjulday + rdt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. ) 1662 1640 clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname)) 1663 1641 idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') … … 1666 1644 idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@') 1667 1645 DO WHILE ( idx /= 0 ) 1668 cldate = iom_sdate( fjulday + rdt tra(1)/ rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. )1646 cldate = iom_sdate( fjulday + rdt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. ) 1669 1647 clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname)) 1670 1648 idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@')
Note: See TracChangeset
for help on using the changeset viewer.