Changeset 7646 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
- Timestamp:
- 2017-02-06T10:25:03+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r6519 r7646 9 9 !! 3.4 ! 2012-12 (R. Bourdalle-Badie and G. Reffray) add C1D case 10 10 !! 3.6 ! 2014-15 DIMG format removed 11 !! 3.6 ! 2015-15 (J. Harle) Added procedure to read REAL attributes 11 12 !!-------------------------------------------------------------------- 12 13 … … 52 53 LOGICAL, PUBLIC, PARAMETER :: lk_iomput = .FALSE. !: iom_put flag 53 54 #endif 54 PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 55 PUBLIC iom_getatt, iom_use, iom_context_finalize 55 PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 56 PUBLIC iom_getatt, iom_putatt, iom_gettime, iom_rstput, iom_put 57 PUBLIC iom_use, iom_context_finalize 56 58 57 59 PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d … … 67 69 END INTERFACE 68 70 INTERFACE iom_getatt 69 MODULE PROCEDURE iom_g0d_intatt 71 MODULE PROCEDURE iom_g0d_iatt, iom_g0d_ratt, iom_g0d_catt 72 END INTERFACE 73 INTERFACE iom_putatt 74 MODULE PROCEDURE iom_p0d_iatt, iom_p0d_ratt, iom_p0d_catt 70 75 END INTERFACE 71 76 INTERFACE iom_rstput … … 93 98 CHARACTER(len=*), INTENT(in) :: cdname 94 99 #if defined key_iomput 95 TYPE(xios_time) :: dtime = xios_time(0, 0, 0, 0, 0, 0) 96 CHARACTER(len=19) :: cldate 100 101 TYPE(xios_duration) :: dtime = xios_duration(0, 0, 0, 0, 0, 0) 102 TYPE(xios_date) :: start_date 97 103 CHARACTER(len=10) :: clname 98 INTEGER :: ji99 ! 100 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z _bnds101 !!---------------------------------------------------------------------- 102 103 ALLOCATE( z _bnds(jpk,2) )104 INTEGER :: ji, jkmin 105 ! 106 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds 107 !!---------------------------------------------------------------------- 108 109 ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 104 110 105 111 clname = cdname … … 108 114 CALL iom_swap( cdname ) 109 115 110 ! calendar parameters 116 117 ! Calendar type is now defined in xml file 111 118 SELECT CASE ( nleapy ) ! Choose calendar for IOIPSL 112 CASE ( 1) ; CALL xios_set_context_attr(TRIM(clname), calendar_type= "Gregorian") 113 CASE ( 0) ; CALL xios_set_context_attr(TRIM(clname), calendar_type= "NoLeap") 114 CASE (30) ; CALL xios_set_context_attr(TRIM(clname), calendar_type= "D360") 119 CASE ( 1) ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(1900,01,01,00,00,00), & 120 & start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 121 CASE ( 0) ; CALL xios_define_calendar( TYPE = "NoLeap" , time_origin = xios_date(1900,01,01,00,00,00), & 122 & start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 123 CASE (30) ; CALL xios_define_calendar( TYPE = "D360" , time_origin = xios_date(1900,01,01,00,00,00), & 124 & start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 115 125 END SELECT 116 WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' ',i2.2,':',i2.2,':00')") nyear,nmonth,nday,nhour,nminute117 CALL xios_set_context_attr(TRIM(clname), start_date=cldate )118 126 119 127 ! horizontal grid definition … … 169 177 170 178 ! Add vertical grid bounds 171 z_bnds(: ,1) = gdepw_1d(:) 172 z_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 173 z_bnds(jpk: ,2) = gdepw_1d(jpk) + e3t_1d(jpk) 174 CALL iom_set_axis_attr( "deptht", bounds=z_bnds ) 175 CALL iom_set_axis_attr( "depthu", bounds=z_bnds ) 176 CALL iom_set_axis_attr( "depthv", bounds=z_bnds ) 177 z_bnds(: ,2) = gdept_1d(:) 178 z_bnds(2:jpk,1) = gdept_1d(1:jpkm1) 179 z_bnds(1 ,1) = gdept_1d(1) - e3w_1d(1) 180 CALL iom_set_axis_attr( "depthw", bounds=z_bnds ) 179 jkmin = MIN(2,jpk) ! in case jpk=1 (i.e. sas2D) 180 zt_bnds(2,: ) = gdept_1d(:) 181 zt_bnds(1,jkmin:jpk) = gdept_1d(1:jpkm1) 182 zt_bnds(1,1 ) = gdept_1d(1) - e3w_1d(1) 183 zw_bnds(1,: ) = gdepw_1d(:) 184 zw_bnds(2,1:jpkm1 ) = gdepw_1d(jkmin:jpk) 185 zw_bnds(2,jpk: ) = gdepw_1d(jpk) + e3t_1d(jpk) 186 CALL iom_set_axis_attr( "deptht", bounds=zt_bnds ) 187 CALL iom_set_axis_attr( "depthu", bounds=zt_bnds ) 188 CALL iom_set_axis_attr( "depthv", bounds=zt_bnds ) 189 CALL iom_set_axis_attr( "depthw", bounds=zw_bnds ) 190 181 191 182 192 # if defined key_floats … … 200 210 CALL xios_update_calendar(0) 201 211 202 DEALLOCATE( z _bnds )212 DEALLOCATE( zt_bnds, zw_bnds ) 203 213 204 214 #endif … … 789 799 ENDIF 790 800 IF( PRESENT(pv_r3d) ) THEN 791 IF( idom == jpdom_data ) THEN ; icnt(3) = jpk dta801 IF( idom == jpdom_data ) THEN ; icnt(3) = jpkglo 792 802 ELSE IF( ll_depth_spec .AND. PRESENT(kstart) ) THEN ; istart(3) = kstart(3); icnt(3) = kcount(3) 793 803 ELSE ; icnt(3) = jpk … … 971 981 !! INTERFACE iom_getatt 972 982 !!---------------------------------------------------------------------- 973 SUBROUTINE iom_g0d_i ntatt( kiomid, cdatt, pvar )983 SUBROUTINE iom_g0d_iatt( kiomid, cdatt, pvar, cdvar ) 974 984 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 975 985 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 976 986 INTEGER , INTENT( out) :: pvar ! read field 987 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 977 988 ! 978 989 IF( kiomid > 0 ) THEN 979 990 IF( iom_file(kiomid)%nfid > 0 ) THEN 980 991 SELECT CASE (iom_file(kiomid)%iolib) 981 CASE (jpnf90 ) ; CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 992 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 993 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 994 ELSE 995 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 996 ENDIF 982 997 CASE DEFAULT 983 CALL ctl_stop( 'iom_g0d_ att: accepted IO library is only jpnf90' )998 CALL ctl_stop( 'iom_g0d_iatt: accepted IO library is only jpnf90' ) 984 999 END SELECT 985 1000 ENDIF 986 1001 ENDIF 987 END SUBROUTINE iom_g0d_intatt 988 1002 END SUBROUTINE iom_g0d_iatt 1003 1004 SUBROUTINE iom_g0d_ratt( kiomid, cdatt, pvar, cdvar ) 1005 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1006 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 1007 REAL(wp) , INTENT( out) :: pvar ! written field 1008 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1009 ! 1010 IF( kiomid > 0 ) THEN 1011 IF( iom_file(kiomid)%nfid > 0 ) THEN 1012 SELECT CASE (iom_file(kiomid)%iolib) 1013 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1014 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1015 ELSE 1016 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 1017 ENDIF 1018 CASE DEFAULT 1019 CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 1020 END SELECT 1021 ENDIF 1022 ENDIF 1023 END SUBROUTINE iom_g0d_ratt 1024 1025 SUBROUTINE iom_g0d_catt( kiomid, cdatt, pvar, cdvar ) 1026 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1027 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 1028 CHARACTER(len=*), INTENT( out) :: pvar ! written field 1029 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1030 ! 1031 IF( kiomid > 0 ) THEN 1032 IF( iom_file(kiomid)%nfid > 0 ) THEN 1033 SELECT CASE (iom_file(kiomid)%iolib) 1034 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1035 CALL iom_nf90_getatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1036 ELSE 1037 CALL iom_nf90_getatt( kiomid, cdatt, pvar ) 1038 ENDIF 1039 CASE DEFAULT 1040 CALL ctl_stop( 'iom_g0d_ratt: accepted IO library is only jpnf90' ) 1041 END SELECT 1042 ENDIF 1043 ENDIF 1044 END SUBROUTINE iom_g0d_catt 1045 1046 !!---------------------------------------------------------------------- 1047 !! INTERFACE iom_putatt 1048 !!---------------------------------------------------------------------- 1049 SUBROUTINE iom_p0d_iatt( kiomid, cdatt, pvar, cdvar ) 1050 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1051 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 1052 INTEGER , INTENT(in ) :: pvar ! write field 1053 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1054 ! 1055 IF( kiomid > 0 ) THEN 1056 IF( iom_file(kiomid)%nfid > 0 ) THEN 1057 SELECT CASE (iom_file(kiomid)%iolib) 1058 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1059 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1060 ELSE 1061 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1062 ENDIF 1063 CASE DEFAULT 1064 CALL ctl_stop( 'iom_p0d_iatt: accepted IO library is only jpnf90' ) 1065 END SELECT 1066 ENDIF 1067 ENDIF 1068 END SUBROUTINE iom_p0d_iatt 1069 1070 SUBROUTINE iom_p0d_ratt( kiomid, cdatt, pvar, cdvar ) 1071 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1072 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 1073 REAL(wp) , INTENT(in ) :: pvar ! write field 1074 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1075 ! 1076 IF( kiomid > 0 ) THEN 1077 IF( iom_file(kiomid)%nfid > 0 ) THEN 1078 SELECT CASE (iom_file(kiomid)%iolib) 1079 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1080 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1081 ELSE 1082 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1083 ENDIF 1084 CASE DEFAULT 1085 CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 1086 END SELECT 1087 ENDIF 1088 ENDIF 1089 END SUBROUTINE iom_p0d_ratt 1090 1091 SUBROUTINE iom_p0d_catt( kiomid, cdatt, pvar, cdvar ) 1092 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1093 CHARACTER(len=*), INTENT(in ) :: cdatt ! Name of the attribute 1094 CHARACTER(len=*), INTENT(in ) :: pvar ! write field 1095 CHARACTER(len=*), INTENT(in ), OPTIONAL :: cdvar ! Name of the variable 1096 ! 1097 IF( kiomid > 0 ) THEN 1098 IF( iom_file(kiomid)%nfid > 0 ) THEN 1099 SELECT CASE (iom_file(kiomid)%iolib) 1100 CASE (jpnf90 ) ; IF( PRESENT(cdvar) ) THEN 1101 CALL iom_nf90_putatt( kiomid, cdatt, pvar, cdvar=cdvar ) 1102 ELSE 1103 CALL iom_nf90_putatt( kiomid, cdatt, pvar ) 1104 ENDIF 1105 CASE DEFAULT 1106 CALL ctl_stop( 'iom_p0d_ratt: accepted IO library is only jpnf90' ) 1107 END SELECT 1108 ENDIF 1109 ENDIF 1110 END SUBROUTINE iom_p0d_catt 989 1111 990 1112 !!---------------------------------------------------------------------- … … 1130 1252 REAL(wp), DIMENSION(:) , OPTIONAL, INTENT(in) :: lonvalue, latvalue 1131 1253 REAL(wp), DIMENSION(:,:) , OPTIONAL, INTENT(in) :: bounds_lon, bounds_lat, area 1132 LOGICAL, DIMENSION(:,:) , OPTIONAL, INTENT(in) :: mask 1254 LOGICAL, DIMENSION(:) , OPTIONAL, INTENT(in) :: mask 1255 1133 1256 1134 1257 IF ( xios_is_valid_domain (cdid) ) THEN 1135 1258 CALL xios_set_domain_attr ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj, & 1136 1259 & data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj , & 1137 & zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj, & 1138 & lonvalue=lonvalue, latvalue=latvalue, mask=mask, nvertex=nvertex, bounds_lon=bounds_lon, & 1139 & bounds_lat=bounds_lat, area=area ) 1140 ENDIF 1141 1260 & lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon, & 1261 & bounds_lat_1D=bounds_lat, area=area, type='curvilinear') 1262 ENDIF 1142 1263 IF ( xios_is_valid_domaingroup(cdid) ) THEN 1143 1264 CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj, & 1144 1265 & data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj , & 1145 & zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,&1146 & lonvalue=lonvalue, latvalue=latvalue, mask=mask, nvertex=nvertex, bounds_lon=bounds_lon, &1147 & bounds_lat=bounds_lat, area=area )1148 ENDIF 1266 & lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon, & 1267 & bounds_lat_1D=bounds_lat, area=area, type='curvilinear' ) 1268 ENDIF 1269 1149 1270 CALL xios_solve_inheritance() 1150 1271 1151 1272 END SUBROUTINE iom_set_domain_attr 1273 1274 1275 SUBROUTINE iom_set_zoom_domain_attr( cdid, ibegin, jbegin, ni, nj) 1276 CHARACTER(LEN=*) , INTENT(in) :: cdid 1277 INTEGER , OPTIONAL, INTENT(in) :: ibegin, jbegin, ni, nj 1278 1279 IF ( xios_is_valid_zoom_domain (cdid) ) THEN 1280 CALL xios_set_zoom_domain_attr ( cdid, ibegin=ibegin, jbegin=jbegin, ni=ni, & 1281 & nj=nj) 1282 ENDIF 1283 END SUBROUTINE iom_set_zoom_domain_attr 1152 1284 1153 1285 … … 1156 1288 REAL(wp), DIMENSION(:) , OPTIONAL, INTENT(in) :: paxis 1157 1289 REAL(wp), DIMENSION(:,:), OPTIONAL, INTENT(in) :: bounds 1290 1158 1291 IF ( PRESENT(paxis) ) THEN 1159 IF ( xios_is_valid_axis (cdid) ) CALL xios_set_axis_attr ( cdid, size=SIZE(paxis), value=paxis )1160 IF ( xios_is_valid_axisgroup(cdid) ) CALL xios_set_axisgroup_attr( cdid, size=SIZE(paxis), value=paxis )1292 IF ( xios_is_valid_axis (cdid) ) CALL xios_set_axis_attr ( cdid, n_glo=SIZE(paxis), value=paxis ) 1293 IF ( xios_is_valid_axisgroup(cdid) ) CALL xios_set_axisgroup_attr( cdid, n_glo=SIZE(paxis), value=paxis ) 1161 1294 ENDIF 1162 1295 IF ( xios_is_valid_axis (cdid) ) CALL xios_set_axis_attr ( cdid, bounds=bounds ) … … 1168 1301 SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 1169 1302 CHARACTER(LEN=*) , INTENT(in) :: cdid 1170 CHARACTER(LEN=*),OPTIONAL , INTENT(in) :: freq_op1171 CHARACTER(LEN=*),OPTIONAL , INTENT(in) :: freq_offset1303 TYPE(xios_duration),OPTIONAL , INTENT(in) :: freq_op 1304 TYPE(xios_duration),OPTIONAL , INTENT(in) :: freq_offset 1172 1305 IF ( xios_is_valid_field (cdid) ) CALL xios_set_field_attr & 1173 1306 & ( cdid, freq_op=freq_op, freq_offset=freq_offset ) … … 1189 1322 SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq ) 1190 1323 CHARACTER(LEN=*) , INTENT(in ) :: cdid 1191 CHARACTER(LEN=*),OPTIONAL , INTENT(out) :: name, name_suffix, output_freq 1324 CHARACTER(LEN=*),OPTIONAL , INTENT(out) :: name, name_suffix 1325 TYPE(xios_duration), OPTIONAL , INTENT(out) :: output_freq 1192 1326 LOGICAL :: llexist1,llexist2,llexist3 1193 1327 !--------------------------------------------------------------------- 1194 1328 IF( PRESENT( name ) ) name = '' ! default values 1195 1329 IF( PRESENT( name_suffix ) ) name_suffix = '' 1196 IF( PRESENT( output_freq ) ) output_freq = ''1330 IF( PRESENT( output_freq ) ) output_freq = xios_duration(0,0,0,0,0,0) 1197 1331 IF ( xios_is_valid_file (cdid) ) THEN 1198 1332 CALL xios_solve_inheritance() … … 1215 1349 CHARACTER(LEN=*) , INTENT(in) :: cdid 1216 1350 LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) :: mask 1217 IF ( xios_is_valid_grid (cdid) ) CALL xios_set_grid_attr ( cdid, mask =mask )1218 IF ( xios_is_valid_gridgroup(cdid) ) CALL xios_set_gridgroup_attr( cdid, mask =mask )1351 IF ( xios_is_valid_grid (cdid) ) CALL xios_set_grid_attr ( cdid, mask_3D=mask ) 1352 IF ( xios_is_valid_gridgroup(cdid) ) CALL xios_set_gridgroup_attr( cdid, mask_3D=mask ) 1219 1353 CALL xios_solve_inheritance() 1220 1354 END SUBROUTINE iom_set_grid_attr … … 1258 1392 ni=nlei-nldi+1 ; nj=nlej-nldj+1 1259 1393 1260 CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi- 1, jbegin=njmpp+nldj-1, ni=ni, nj=nj)1394 CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 1261 1395 CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 1262 1396 CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)), & … … 1272 1406 END SELECT 1273 1407 ! 1274 CALL iom_set_domain_attr( "grid_"//cdgrd , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni ,nj /)) /= 0. )1408 CALL iom_set_domain_attr( "grid_"//cdgrd , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni*nj /)) /= 0. ) 1275 1409 CALL iom_set_grid_attr ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 1276 1410 ENDIF … … 1406 1540 ALLOCATE( zlon(ni*nj) ) ; zlon(:) = 0. 1407 1541 1408 CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 1542 CALL dom_ngb( 180., 90., ix, iy, 'T' ) ! i-line that passes near the North Pole : Reference latitude (used in plots) 1543 CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 1409 1544 CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 1410 1545 CALL iom_set_domain_attr("gznl", lonvalue = zlon, & 1411 1546 & latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /))) 1412 ! 1413 CALL dom_ngb( 180., 90., ix, iy, 'T' ) ! i-line that passes near the North Pole : Reference latitude (used in plots) 1414 CALL iom_set_domain_attr ('ptr', zoom_ibegin=ix, zoom_nj=jpjglo) 1547 CALL iom_set_zoom_domain_attr ("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=jpjglo) 1548 ! 1415 1549 CALL iom_update_file_name('ptr') 1416 1550 ! … … 1426 1560 REAL(wp), DIMENSION(1) :: zz = 1. 1427 1561 !!---------------------------------------------------------------------- 1428 CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 1562 1563 CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea-1, jbegin=0, ni=1, nj=1) 1429 1564 CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 1430 1565 … … 1455 1590 REAL(wp) ,DIMENSION( 3) :: zlonpira ! longitudes of pirata moorings 1456 1591 REAL(wp) ,DIMENSION( 9) :: zlatpira ! latitudes of pirata moorings 1592 TYPE(xios_duration) :: f_op, f_of 1457 1593 !!---------------------------------------------------------------------- 1458 1594 ! 1459 1595 ! frequency of the call of iom_put (attribut: freq_op) 1460 WRITE(cl1,'(i1)') 1 ; CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts')1461 WRITE(cl1,'(i1)') nn_fsbc ; CALL iom_set_field_attr('SBC' , freq_op = cl1//'ts', freq_offset='0ts')1462 WRITE(cl1,'(i1)') nn_fsbc ; CALL iom_set_field_attr('SBC_scalar' , freq_op = cl1//'ts', freq_offset='0ts')1463 WRITE(cl1,'(i1)') nn_dttrc ; CALL iom_set_field_attr('ptrc_T' , freq_op = cl1//'ts', freq_offset='0ts')1464 WRITE(cl1,'(i1)') nn_dttrc ; CALL iom_set_field_attr('diad_T' , freq_op = cl1//'ts', freq_offset='0ts')1465 1596 f_op%timestep = 1 ; f_of%timestep = 0 ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 1597 f_op%timestep = nn_fsbc ; f_of%timestep = 0 ; CALL iom_set_field_attr('SBC' , freq_op=f_op, freq_offset=f_of) 1598 f_op%timestep = nn_fsbc ; f_of%timestep = 0 ; CALL iom_set_field_attr('SBC_scalar' , freq_op=f_op, freq_offset=f_of) 1599 f_op%timestep = nn_dttrc ; f_of%timestep = 0 ; CALL iom_set_field_attr('ptrc_T' , freq_op=f_op, freq_offset=f_of) 1600 f_op%timestep = nn_dttrc ; f_of%timestep = 0 ; CALL iom_set_field_attr('diad_T' , freq_op=f_op, freq_offset=f_of) 1601 1466 1602 ! output file names (attribut: name) 1467 1603 DO ji = 1, 9 … … 1484 1620 ! Equatorial section (attributs: jbegin, ni, name_suffix) 1485 1621 CALL dom_ngb( 0., 0., ix, iy, cl1 ) 1486 CALL iom_set_ domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo)1622 CALL iom_set_zoom_domain_attr ('Eq'//cl1, jbegin=iy-1, ni=jpiglo) 1487 1623 CALL iom_get_file_attr ('Eq'//cl1, name_suffix = clsuff ) 1488 1624 CALL iom_set_file_attr ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq') … … 1564 1700 ENDIF 1565 1701 clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 1566 CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 1702 CALL iom_set_zoom_domain_attr (TRIM(clname)//cl1, ibegin= ix-1, jbegin= iy-1) 1703 1567 1704 CALL iom_get_file_attr (TRIM(clname)//cl1, name_suffix = clsuff ) 1568 1705 CALL iom_set_file_attr (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname)) … … 1593 1730 REAL(wp) :: zsec 1594 1731 LOGICAL :: llexist 1732 TYPE(xios_duration) :: output_freq 1595 1733 !!---------------------------------------------------------------------- 1596 1734 1597 1735 DO jn = 1,2 1598 1736 1599 IF( jn == 1 ) CALL iom_get_file_attr( cdid, name = clname, output_freq = clfreq ) 1737 output_freq = xios_duration(0,0,0,0,0,0) 1738 IF( jn == 1 ) CALL iom_get_file_attr( cdid, name = clname, output_freq = output_freq ) 1600 1739 IF( jn == 2 ) CALL iom_get_file_attr( cdid, name_suffix = clname ) 1601 1740 … … 1610 1749 idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 1611 1750 DO WHILE ( idx /= 0 ) 1612 IF ( TRIM(clfreq) /= '' ) THEN 1613 itrlen = LEN_TRIM(clfreq) 1614 IF ( clfreq(itrlen-1:itrlen) == 'mo' ) clfreq = clfreq(1:itrlen-1) 1615 clname = clname(1:idx-1)//TRIM(clfreq)//clname(idx+6:LEN_TRIM(clname)) 1616 ELSE 1751 IF ( output_freq%timestep /= 0) THEN 1752 WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 1753 itrlen = LEN_TRIM(ADJUSTL(clfreq)) 1754 ELSE IF ( output_freq%hour /= 0 ) THEN 1755 WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 1756 itrlen = LEN_TRIM(ADJUSTL(clfreq)) 1757 ELSE IF ( output_freq%day /= 0 ) THEN 1758 WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 1759 itrlen = LEN_TRIM(ADJUSTL(clfreq)) 1760 ELSE IF ( output_freq%month /= 0 ) THEN 1761 WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 1762 itrlen = LEN_TRIM(ADJUSTL(clfreq)) 1763 ELSE IF ( output_freq%year /= 0 ) THEN 1764 WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 1765 itrlen = LEN_TRIM(ADJUSTL(clfreq)) 1766 ELSE 1617 1767 CALL ctl_stop('error in the name of file id '//TRIM(cdid), & 1618 1768 & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) ) 1619 ENDIF 1620 idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 1769 ENDIF 1770 clname = clname(1:idx-1)//TRIM(ADJUSTL(clfreq))//clname(idx+6:LEN_TRIM(clname)) 1771 idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 1621 1772 END DO 1622 1773
Note: See TracChangeset
for help on using the changeset viewer.