- Timestamp:
- 2014-09-26T13:04:47+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4621_NOC4_BDY_VERT_INTERP/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r4292 r4792 32 32 USE trc_oce, ONLY : nn_dttrc ! !: frequency of step on passive tracers 33 33 USE icb_oce, ONLY : nclasses, class_num ! !: iceberg classes 34 #if defined key_lim3 35 USE par_ice 36 #elif defined key_lim2 37 USE par_ice_2 38 #endif 34 39 USE domngb ! ocean space and time domain 35 40 USE phycst ! physical constants … … 49 54 #endif 50 55 PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 51 PUBLIC iom_getatt, iom_ context_finalize56 PUBLIC iom_getatt, iom_use, iom_context_finalize 52 57 53 58 PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d … … 63 68 END INTERFACE 64 69 INTERFACE iom_getatt 65 MODULE PROCEDURE iom_g0d_intatt 70 MODULE PROCEDURE iom_g0d_intatt, iom_g0d_ratt 66 71 END INTERFACE 67 72 INTERFACE iom_rstput … … 143 148 CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) ) 144 149 # endif 150 #if defined key_lim3 || defined key_lim2 151 CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) ) 152 #endif 145 153 CALL iom_set_axis_attr( "icbcla", class_num ) 146 154 … … 344 352 CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) 345 353 istop = nstop + 1 ! make sure that istop /= nstop so we don't open the file 354 ELSEIF( llwrt ) THEN ! the file exists and we are in write mode with permission to 355 clname = cltmpn ! overwrite so get back the file name without the cpu number 346 356 ENDIF 347 357 ENDIF … … 896 906 !! INTERFACE iom_getatt 897 907 !!---------------------------------------------------------------------- 898 SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar )908 SUBROUTINE iom_g0d_intatt( kiomid, cdatt, pvar, cdvar ) 899 909 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 900 910 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 901 INTEGER , INTENT( out) :: pvar ! read field 911 INTEGER , INTENT( out) :: pvar ! written field 912 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 902 913 ! 903 914 IF( kiomid > 0 ) THEN … … 905 916 SELECT CASE (iom_file(kiomid)%iolib) 906 917 CASE (jpioipsl ) ; CALL ctl_stop('iom_getatt: only nf90 available') 907 CASE (jpnf90 ) ; CALL iom_nf90_getatt( kiomid, cdatt, pv ar )918 CASE (jpnf90 ) ; CALL iom_nf90_getatt( kiomid, cdatt, pv_i0d=pvar ) 908 919 CASE (jprstdimg) ; CALL ctl_stop('iom_getatt: only nf90 available') 909 920 CASE DEFAULT … … 914 925 END SUBROUTINE iom_g0d_intatt 915 926 927 SUBROUTINE iom_g0d_ratt( kiomid, cdatt, pvar, cdvar ) 928 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 929 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 930 REAL(wp) , INTENT( out) :: pvar ! written field 931 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 932 ! 933 IF( kiomid > 0 ) THEN 934 IF( iom_file(kiomid)%nfid > 0 ) THEN 935 SELECT CASE (iom_file(kiomid)%iolib) 936 CASE (jpioipsl ) ; CALL ctl_stop('iom_getatt: only nf90 available') 937 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 938 CALL iom_nf90_getatt( kiomid, cdatt, pv_r0d=pvar, cdvar=cdvar ) 939 ELSE 940 CALL iom_nf90_getatt( kiomid, cdatt, pv_r0d=pvar ) 941 ENDIF 942 CASE (jprstdimg) ; CALL ctl_stop('iom_getatt: only nf90 available') 943 CASE DEFAULT 944 CALL ctl_stop( 'iom_g0d_att: accepted IO library are only jpioipsl, jpnf90 and jprstdimg' ) 945 END SELECT 946 ENDIF 947 ENDIF 948 END SUBROUTINE iom_g0d_ratt 916 949 917 950 !!---------------------------------------------------------------------- … … 1013 1046 CHARACTER(LEN=*), INTENT(in) :: cdname 1014 1047 REAL(wp) , INTENT(in) :: pfield0d 1048 REAL(wp) , DIMENSION(jpi,jpj) :: zz ! masson 1015 1049 #if defined key_iomput 1016 CALL xios_send_field(cdname, (/pfield0d/)) 1050 zz(:,:)=pfield0d 1051 CALL xios_send_field(cdname, zz) 1052 !CALL xios_send_field(cdname, (/pfield0d/)) 1017 1053 #else 1018 1054 IF( .FALSE. ) WRITE(numout,*) cdname, pfield0d ! useless test to avoid compilation warnings … … 1205 1241 !! 1206 1242 !!---------------------------------------------------------------------- 1207 REAL(wp), DIMENSION(1 ,1) :: zz = 1.1243 REAL(wp), DIMENSION(1) :: zz = 1. 1208 1244 !!---------------------------------------------------------------------- 1209 1245 CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 1210 CALL iom_set_domain_attr('scalarpoint', data_dim=1) 1211 CALL iom_set_domain_attr('scalarpoint', lonvalue=(/ zz /), latvalue=(/ zz /)) 1246 CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 1247 zz=REAL(narea,wp) 1248 CALL iom_set_domain_attr('scalarpoint', lonvalue=zz, latvalue=zz) 1212 1249 1213 1250 END SUBROUTINE set_scalar … … 1497 1534 1498 1535 #endif 1536 1537 LOGICAL FUNCTION iom_use( cdname ) 1538 CHARACTER(LEN=*), INTENT(in) :: cdname 1539 #if defined key_iomput 1540 iom_use = xios_field_is_active( cdname ) 1541 #else 1542 iom_use = .FALSE. 1543 #endif 1544 END FUNCTION iom_use 1499 1545 1500 1546 !!======================================================================
Note: See TracChangeset
for help on using the changeset viewer.