From a4b0cb859aef014b1b14a652102c8d12f9849169 Mon Sep 17 00:00:00 2001 From: DSenftleben Date: Mon, 14 May 2018 17:34:22 +0200 Subject: [PATCH 1/3] reformat_scripts/obs/reformat_obs_PIOMAS.f90 --- reformat_scripts/obs/reformat_obs_PIOMAS.f90 | 368 +++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 reformat_scripts/obs/reformat_obs_PIOMAS.f90 diff --git a/reformat_scripts/obs/reformat_obs_PIOMAS.f90 b/reformat_scripts/obs/reformat_obs_PIOMAS.f90 new file mode 100644 index 0000000000..d67c409e2b --- /dev/null +++ b/reformat_scripts/obs/reformat_obs_PIOMAS.f90 @@ -0,0 +1,368 @@ +!############################################################################# +! REFORMAT SCRIPT FOR PIOMAS ARCTIC SEA ICE THICKNESS REANALYSES +!############################################################################# +! +! Tier +! 2 (freely available data set other than obs4MIPs and ana4MIPs) +! +! Source +! ftp://pscftp.apl.washington.edu/zhang/PIOMAS/data/v2.1/heff/ +! Reference: +! Zhang, Jinlun and D.A. Rothrock: Modeling global sea ice with a thickness +! and enthalpy distribution model in generalized curvilinear coordinates, +! Mon. Wea. Rev. 131(5), 681-697, 2003. +! +! Last access +! 05/2018 +! +! Download and processing instructions +! Download all files from above website. +! Download 'grid.dat', 'grid.dat.pop' and 'io.dat_360_120.output' from +! http://psc.apl.uw.edu/research/projects/arctic-sea-ice-volume-anomaly/data/model_grid +! Adapt 'inpath' & 'outpath' in this script to your system. +! Process this script (reformat_obs_PIOMAS.f90). +! +! Caveats +! Fortran netCDF libraries required for compilation. +! +! Modification history +! 20180514-A_laue_ax: written. +! +!############################################################################ + +program convert_piomas + + use netcdf + + implicit none + + character (len = *), parameter :: inpath = & + '/export/pa_data01/ESMVal/obs/RAW/Tier2/PIOMAS/' + character (len = *), parameter :: outpath = & +! '/export/pa_data02/ESMVal/obs/Tier2/PIOMAS/' + './' + + integer, parameter :: nx1 = 360 + integer, parameter :: ny1 = 120 + integer, parameter :: nx = nx1 + integer, parameter :: ny = ny1 + integer, parameter :: imt = nx1 + integer, parameter :: jmt = ny1 + + integer, parameter :: nyear1 = 1978 + integer, parameter :: nyear2 = 2017 + + real, dimension(imt, jmt) :: heff, uice, vice + real, dimension(imt, jmt) :: clon, clat + real, dimension(imt, jmt) :: ulat, ulon, HTN, HTE + real, dimension(imt, jmt) :: HUS, HUW, angle, dxt, dyt + real, dimension(imt, jmt) :: area + + integer, dimension(imt, jmt) :: kmt + + integer, dimension(imt) :: iVar + integer, dimension(jmt) :: jVar + + character *80 fopen(5), f1, f2, f3 + character *4 cyear(1900:2100), cyear1(1900:2100) + character *12 char + integer SLEN + + integer :: i, j, t + integer :: imon, iyear + + double precision, dimension(1) :: time + + integer status + integer :: ncID + integer :: unlimitedDimID + integer :: LonDimID, LatDimID, TimeDimID + integer :: LonVarID, LatVarID, TimeVarID, outVarID, outAreaID + integer :: iDimID, jDimID, iVarID, jVarID + integer :: oldfillmode + + character (len = 256) :: outfile + character (len = 9) :: period + + real, parameter :: fillval = 1.e20 + + f2 = inpath // 'heff.H' + + ! read lon and lat for scalar fields (like sea ice thickness and concentration) + open(20, file = inpath // 'grid.dat') + read(20,'(10f8.2)') ((clon(i, j), i = 1, nx1), j = 1, ny1) + read(20,'(10f8.2)') ((clat(i, j), i = 1, nx1), j = 1, ny1) + close(20) + + ! read lon and lat for vector fields (like sea ice and ocean veclocities) + open(24, file = inpath // 'grid.dat.pop') + read(24,'(10f8.2)') ((ulat(i, j), i = 1, nx), j = 1, ny) + read(24,'(10f8.2)') ((ulon(i, j), i = 1, nx), j = 1, ny) + ! HTN, HTE, HUS, HUW are lengths of the 4 sides of a grid cell in km + ! HTN, HTE are lengths of the northern and eastern sides of a scaler grid cell in km, HTN*HTE is + ! the area of a scaler grid cell in km**2 and can be used to calculate sea ice volume and volumes + ! of other variables + ! HUS, HUW are lengths of the southern and western sides of a vector grid cell in km + read(24,'(10f8.2)') ((HTN (i, j), i = 1, nx), j = 1, ny) + read(24,'(10f8.2)') ((HTE (i, j), i = 1, nx), j = 1, ny) + read(24,'(10f8.2)') ((HUS (i, j), i = 1, nx), j = 1, ny) + read(24,'(10f8.2)') ((HUW (i, j), i = 1, nx), j = 1, ny) + ! angle is the angle between latitude line and grid cell x-coordinate line, needed for plotting + ! vectors in spherical coordinate system + read(24,'(10f8.2)') ((angle(i, j), i = 1, nx), j = 1, ny) + close(24) + + ! read model grid mask; ocean levels > 0, land <= 0 + open(20, file = inpath // 'io.dat_360_120.output') + read(20,'(360i2)') kmt + close(20) + + area(:, :) = HTN(:, :) * HTE(:, :) * 1.0e6 ! m2 + + ! -------------------------------------------------------------------------- + + write(outfile, '(a,i4,a,i4,a)') outpath // 'OBS_PIOMAS_reanaly_2-1_T2Ms_sit_', & + nyear1, '01-', nyear2, '12.nc' + + write(period, '(i4,a,i4)') nyear1, '-', nyear2 + + ! open new NetCDF file (write) + + status = NF90_CREATE(trim(outfile), NF90_Write, ncID) + if (status /= nf90_NoErr) call handle_err(status) + + ! set fill mode to NO_FILL + + status = NF90_SET_FILL(ncID, NF90_NOFILL, oldfillmode) + if (status /= nf90_NoErr) call handle_err(status) + + ! create dimensions + + status = NF90_DEF_DIM(ncID, "i", nx1, iDimID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_DIM(ncID, "j", ny1, jDimID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_DIM(ncID, "time", NF90_UNLIMITED, TimeDimID) + if (status /= nf90_NoErr) call handle_err(status) + + ! create dimension variables + + status = NF90_DEF_VAR(ncID, "i", NF90_INT, iDimID, iVarID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_VAR(ncID, "j", NF90_INT, jDimID, jVarID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_VAR(ncID, "time", NF90_DOUBLE, TimeDimID, TimeVarID) + if (status /= nf90_NoErr) call handle_err(status) + + ! set attributes of dimension variables + + status = NF90_PUT_ATT(ncID, iVarID, "long_name", "cell index along second dimension") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, iVarID, "units", "1") + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_ATT(ncID, jVarID, "long_name", "cell index along first dimension") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, jVarID, "units", "1") + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_ATT(ncID, TimeVarID, "standard_name", "time") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, TimeVarID, "units", "day as %Y%m%d.%f") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, TimeVarID, "axis", "T") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, TimeVarID, "long_name", "time") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, TimeVarID, "calendar", "standard") + if (status /= nf90_NoErr) call handle_err(status) + + ! define variables + + status = NF90_DEF_VAR(ncID, "lat", NF90_FLOAT, (/iDimID, jDimID/), LatVarID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_VAR(ncID, "lon", NF90_FLOAT, (/iDimID, jDimID/), LonVarID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_VAR(ncID, "sit", NF90_FLOAT, (/iDimID, jDimID, TimeDimID/), outVarID) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_DEF_VAR(ncID, "areacello", NF90_FLOAT, (/iDimID, jDimID/), outAreaID) + if (status /= nf90_NoErr) call handle_err(status) + + ! set attributes of variables + + status = NF90_PUT_ATT(ncID, LonVarID, "standard_name", "longitude") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LonVarID, "long_name", "longitude") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LonVarID, "units", "degrees_east") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LonVarID, "_CoordinateAxisType", "Lon") + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_ATT(ncID, LatVarID, "standard_name", "latitude") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LatVarID, "long_name", "latitude") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LatVarID, "units", "degrees_north") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, LatVarID, "_CoordinateAxisType", "Lat") + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_ATT(ncID, outVarID, "standard_name", "sea_ice_thickness") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "units", "m") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "long_name", "Sea Ice Thickness") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "comment", & + "the mean thickness of sea ice in the ocean portion of the grid cell " & + // "(averaging over the entire ocean portion, including the ice-free fraction). " & + // "Reported as 0.0 in regions free of sea ice.") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "cell_methods", "time: mean area: mean where sea") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "cell_measures", "area: areacello") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outVarID, "_FillValue", fillval) + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_ATT(ncID, outAreaID, "standard_name", "cell_area") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outAreaID, "units", "m2") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outAreaID, "long_name", "Ocean Grid-Cell Area") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, outAreaID, "_FillValue", fillval) + if (status /= nf90_NoErr) call handle_err(status) + + ! set global attributes + + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "conventions", "CF/CMOR") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "title", "PIOMAS Arctic Sea Ice Volume Reanalysis") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "reference", "Zhang, Jinlun and D.A. Rothrock: " & + // "Modeling global sea ice with a thickness and enthalpy distribution model in " & + // "generalized curvilinear coordinates, Mon. Wea. Rev. 131(5), 681-697, 2003.") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "source", "http://psc.apl.uw.edu/research/" & + // "projects/arctic-sea-ice-volume-anomaly/data/model_grid") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "tier", 2) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "field", "T2Ms") + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "period", period) + if (status /= nf90_NoErr) call handle_err(status) +! status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "user", "xxxx") +! if (status /= nf90_NoErr) call handle_err(status) +! status = NF90_PUT_ATT(ncID, NF90_GLOBAL, "history", "Created on xxxx") +! if (status /= nf90_NoErr) call handle_err(status) + + ! end define mode + + status = NF90_ENDDEF(ncID) + if (status /= nf90_NoErr) call handle_err(status) + + ! write variables i, j, lat, lon, areacello + + do i = 1, imt + iVar(i) = i - 1 + end do + + do j = 1, jmt + jVar(j) = j - 1 + end do + + status = NF90_PUT_VAR(ncID, iVarID, iVar) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_VAR(ncID, jVarID, jVar) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_VAR(ncID, lonVarID, clon) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_VAR(ncID, latVarID, clat) + if (status /= nf90_NoErr) call handle_err(status) + status = NF90_PUT_VAR(ncID, outAreaID, area) + if (status /= nf90_NoErr) call handle_err(status) + + ! -------------------------------------------------------------------------- + + t = 1 ! time step counter + + do iyear = nyear1, nyear2 + + write(unit = cyear(iyear), fmt = '(i4)') iyear + i = slen(f2) + open(2, file = f2(1:i) // cyear(iyear), & + access = 'direct', form = 'unformatted', recl = nx1 * ny1 * 4, & + status='unknown') + + do imon = 1, 12 + time = iyear * 1e4 + imon * 1e2 ! yyymmdd + + read(2, rec = imon)((heff(i, j), i = 1, nx1), j = 1, ny1) + + WHERE (kmt <= 0) + heff = fillval + ENDWHERE + + status = NF90_PUT_VAR(ncID, outvarID, heff(:,:), start = (/1, 1, t/), & + count = (/nx1, ny1, 1/)) + if (status /= nf90_NoErr) call handle_err(status) + + status = NF90_PUT_VAR(ncID, timeVarID, time, start=(/t/), count = (/1/)) + if (status /= nf90_NoErr) call handle_err(status) + + t = t + 1 + + end do + + close(2) + end do + + status = NF90_CLOSE(ncID) + if (status /= nf90_NoErr) call handle_err(status) + + stop + +end program convert_piomas + +! ----------------------------------------------------------------------------- + +INTEGER FUNCTION slen (string) + ! --- + ! --- this function computes the length of a character string less + ! --- trailing blanks + ! --- slen > 0, length of string less trailing blanks + ! --- = 0, character string is blank + ! --- + CHARACTER*(*) string + CHARACTER*1 cblank + INTEGER i + DATA cblank/' '/ + ! --- + DO 50 i = LEN(string), 1, -1 + IF (string(i:i) .NE. ' ') GO TO 100 +50 CONTINUE + i = 0 +100 CONTINUE + slen = i + RETURN +END + +! ----------------------------------------------------------------------------- + +subroutine handle_err(status) + + use netcdf + + implicit none + + integer status + + print *, "NetCDF error: ", trim(NF90_STRERROR(status)) + print *, "Abort." + stop + +end subroutine handle_err + From 7e4a3c0b2d26810d9b7ae9dfafb9d9dcd896a60b Mon Sep 17 00:00:00 2001 From: DSenftleben Date: Wed, 16 May 2018 11:52:47 +0200 Subject: [PATCH 2/3] finalized reformat_obs_PIOMAS.f90 --- reformat_scripts/obs/reformat_obs_PIOMAS.f90 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reformat_scripts/obs/reformat_obs_PIOMAS.f90 b/reformat_scripts/obs/reformat_obs_PIOMAS.f90 index d67c409e2b..3380483a31 100644 --- a/reformat_scripts/obs/reformat_obs_PIOMAS.f90 +++ b/reformat_scripts/obs/reformat_obs_PIOMAS.f90 @@ -71,7 +71,7 @@ program convert_piomas integer :: i, j, t integer :: imon, iyear - double precision, dimension(1) :: time + double precision, dimension(1) :: time, time_ref integer status integer :: ncID @@ -168,7 +168,7 @@ program convert_piomas status = NF90_PUT_ATT(ncID, TimeVarID, "standard_name", "time") if (status /= nf90_NoErr) call handle_err(status) - status = NF90_PUT_ATT(ncID, TimeVarID, "units", "day as %Y%m%d.%f") + status = NF90_PUT_ATT(ncID, TimeVarID, "units", "months since 1950-01-01 00:00:00") if (status /= nf90_NoErr) call handle_err(status) status = NF90_PUT_ATT(ncID, TimeVarID, "axis", "T") if (status /= nf90_NoErr) call handle_err(status) @@ -298,13 +298,15 @@ program convert_piomas status='unknown') do imon = 1, 12 - time = iyear * 1e4 + imon * 1e2 ! yyymmdd + + time_ref = (1950 * 12) + 1 ! reference month = 195001 + time = (iyear * 12) + imon - time_ref ! = months since 195001 read(2, rec = imon)((heff(i, j), i = 1, nx1), j = 1, ny1) - WHERE (kmt <= 0) + where (kmt <= 0) heff = fillval - ENDWHERE + endwhere status = NF90_PUT_VAR(ncID, outvarID, heff(:,:), start = (/1, 1, t/), & count = (/nx1, ny1, 1/)) From 1aa6402d0dd5323fe612be631a4bdf88290b0da0 Mon Sep 17 00:00:00 2001 From: DSenftleben Date: Thu, 17 May 2018 12:13:15 +0200 Subject: [PATCH 3/3] Added sea ice thickness to polcon plots --- diag_scripts/SeaIce_polcon.ncl | 69 ++++++++++--------- diag_scripts/SeaIce_polcon_diff.ncl | 18 +++-- .../source/namelists/namelist_seaice.rst | 35 +++++----- nml/cfg_SeaIce/cfg_SeaIce_NH_sit.ncl | 37 ++++++++++ nml/namelist_SeaIce.xml | 29 ++++++-- nml/test_suites/dlr/namelist_SeaIce.xml | 25 +++++-- 6 files changed, 151 insertions(+), 62 deletions(-) create mode 100644 nml/cfg_SeaIce/cfg_SeaIce_NH_sit.ncl diff --git a/diag_scripts/SeaIce_polcon.ncl b/diag_scripts/SeaIce_polcon.ncl index 498727437b..2fbbffcb95 100644 --- a/diag_scripts/SeaIce_polcon.ncl +++ b/diag_scripts/SeaIce_polcon.ncl @@ -8,7 +8,7 @@ ;; Description ;; Uses original grid (no regridding). ;; Draws sea ice concentration color coded and a red contour line at 0.15 -;; (extent). +;; (extent), or sea ice thickness color coded. ;; Panels multiple plots: starts a new page after max_vert*max_hori ;; ;; Required diag_script_info attributes (diagnostics specific) @@ -28,17 +28,18 @@ ;; showunits: display units in figure title ;; ;; Caveats -;; no masking of the apparent line of missing data between the two grid +;; No masking of the apparent line of missing data between the two grid ;; poles yet (for a workaround, see ;; http://www.ncl.ucar.edu/Applications/Scripts/ice_4.ncl). ;; ;; Modification history -;; 20170512-A_senf_da: Added reporting +;; 20180516-A_senf_da: Adapted to sea ice thickness (sit). +;; 20170512-A_senf_da: Added reporting. ;; 20151027-A_laue_ax: Moved call to 'write_references' to the beginning -;; of the code -;; 20150605-A_vanu_be: Additional attributes for more formatting control +;; of the code. +;; 20150605-A_vanu_be: Additional attributes for more formatting control. ;; 20150325-A_laue_ax: Modified reference tags used for acknowledgements -;; (projects, observations, etc) +;; (projects, observations, etc). ;; 20140623-A_senf_da: res now passed to plot script as attributes of var. ;; 20140312-A_righ_ma: Adapted to new time_operations structure. ;; 20131216-A_vanu_be: Generalized a bit so it can plot other vars. @@ -83,12 +84,12 @@ begin field_type0 = field_types(0) ;; References Information - write_references(diag_script, \ ; script name - "A_gott_kl", \ ; authors - "A_senf_da", \ ; contributors - "D_0001", \ ; diag_references - "", \ ; obs_references - (/"P_embrace", "P_climval"/)) ; proj_acknowledgements + write_references(diag_script, \ ; script name + (/"A_gott_kl", "A_senf_da"/), \ ; authors + "", \ ; contributors + "D_0001", \ ; diag_references + "", \ ; obs_references + (/"P_embrace", "P_climval"/)) ; proj_acknowledgements do idx_mod = 0, dim_MOD - 1 data = read_data(idx_mod, var0, field_type0) @@ -155,22 +156,6 @@ begin ;; open the workstation wks = get_wks(0, diag_script, name_string) - ;; Set contour parameters - grid_min = 0. ; default - grid_max = 1. ; default - grid_step = 0.1 ; default - if (isatt(diag_script_info, "grid_min")) then - grid_min = tofloat(diag_script_info@grid_min) - end if - if (isatt(diag_script_info, "grid_max")) then - grid_max = tofloat(diag_script_info@grid_max) - end if - if (isatt(diag_script_info, "grid_step")) then - grid_step = tofloat(diag_script_info@grid_step) - end if - nsteps = round((grid_max - grid_min) / grid_step, 3) + 1 - cnLevels = fspan(grid_min, grid_max, nsteps) - ;; Define color table ;; "WhiteBlue", "BlueWhiteOrangeRed", "BlueYellowRed" ;"BlWhRe" if (isatt(diag_script_info, "colormap")) then @@ -234,9 +219,11 @@ begin ;; see ./interface_scripts/data_handling.ncl var = extract_data(imod, data, -1, 0, 0) - if (var@units.eq."%") then - var = var / 100. ; Subsequent code works fine without rescaling - var@units = "%/100" ; But annotation is hardcoded for %/100 + if (var0.eq."sic") then + if (var@units.eq."%") then + var = var / 100. ; Subsequent code works fine without rescaling + var@units = "%/100" ; But annotation is hardcoded for %/100 + end if end if ;; Show units in title (default False) @@ -307,6 +294,26 @@ begin ;; resources to be passed to plot routine ; as attributes to var_ann with prefix "res_" + ;; Set contour parameters + grid_min = 0. ; default + if (var0.eq."sic") then + grid_max = 1. ; default + grid_step = 0.1 ; default + else + grid_max = round(max(var_ann), 0) + grid_step = (grid_max - grid_min) / 10. + end if + if (isatt(diag_script_info, "grid_min")) then + grid_min = tofloat(diag_script_info@grid_min) + end if + if (isatt(diag_script_info, "grid_max")) then + grid_max = tofloat(diag_script_info@grid_max) + end if + if (isatt(diag_script_info, "grid_step")) then + grid_step = tofloat(diag_script_info@grid_step) + end if + nsteps = round((grid_max - grid_min) / grid_step, 3) + 1 + cnLevels = fspan(grid_min, grid_max, nsteps) var_ann@res_lbLabelBarOn = lblBarOn ; individual bars var_ann@res_cnLevelSelectionMode = "ExplicitLevels" var_ann@res_cnLevels = cnLevels diff --git a/diag_scripts/SeaIce_polcon_diff.ncl b/diag_scripts/SeaIce_polcon_diff.ncl index e10cb47c01..cf4ff10348 100644 --- a/diag_scripts/SeaIce_polcon_diff.ncl +++ b/diag_scripts/SeaIce_polcon_diff.ncl @@ -237,9 +237,11 @@ begin verbosity, 2) ;; See ./interface_scripts/data_handling.ncl var_raw = extract_data(imod, data, -1, 0, 0) - if (var_raw@units.eq."%") then - var_raw = var_raw / 100. ; Subsequent code expects %/100 - var_raw@units = "%/100" + if (var0.eq."sic") then + if (var_raw@units.eq."%") then + var_raw = var_raw / 100. ; Subsequent code expects %/100 + var_raw@units = "%/100" + end if end if ;; Show units in title (default False) @@ -327,7 +329,6 @@ begin copy_VarMeta(var_regrid, var) var = where(ismissing(var_ref), var_ref@_FillValue, var) var = where(ismissing(var_regrid), var_ref@_FillValue, var) - var@long_name = "~F33~D~F~ of " + var@long_name + strUnits var_perc = 100. * (var_regrid - var_ref) / \ where(var_ref .le. 0., var_ref@_FillValue, var_ref) @@ -343,6 +344,12 @@ begin grid_center = 0.0 ; default if (isatt(diag_script_info, "grid_min")) then grid_min = tofloat(diag_script_info@grid_min) + else + if (var0.eq."sit") then + error_msg("w", diag_script, "", "For sea ice thickness," + \ + " grid min and max values " + \ + " should be specified in the cfg file.") + end if end if if (isatt(diag_script_info, "grid_max")) then grid_max = tofloat(diag_script_info@grid_max) @@ -478,7 +485,8 @@ begin end do contrib_authors = (/"A_gott_kl", "A_senf_da"/) ESMValMD(plot_fname, alltags, caption, id, var0, \ - models@name(ind_models_shown), climofiles, diag_script, contrib_authors) + models@name(ind_models_shown), climofiles, diag_script, \ + contrib_authors) delete([/ seq_num, plot_fname, id, ind_models_shown, \ ind_models_shown_exclref, climofiles /]) end do diff --git a/doc/sphinx/source/namelists/namelist_seaice.rst b/doc/sphinx/source/namelists/namelist_seaice.rst index 13306c30f2..7a8bf9e878 100644 --- a/doc/sphinx/source/namelists/namelist_seaice.rst +++ b/doc/sphinx/source/namelists/namelist_seaice.rst @@ -5,13 +5,14 @@ Sea ice Overview -------- -The sea ice diagnostics cover sea ice extent and concentration, but work is -underway to include other variables and processes in future releases of the -ESMValTool. Current diagnostics include time series of September (Arctic) and -March (Antarctic) sea ice extent calculated as the total area (km\ :sup:`2`\) of grid -cells with sea ice concentrations (sic) of at least 15%. Also included are the -seasonal cycle of sea ice extent, polar stereographic contour and polar -contour difference plots of Arctic and Antarctic sea ice concentrations. +The sea ice diagnostics cover sea ice extent, concentration, and thickness. +Work is underway to include other variables and processes in future releases +of the ESMValTool. Current diagnostics include time series of Arctic and +Antarctic sea ice area and extent (calculated as the total area (km\ :sup:`2`\) +of grid cells with sea ice concentrations (sic) of at least 15%). Also included +are the seasonal cycle of sea ice extent, and polar stereographic contour and +polar contour difference plots of Arctic and Antarctic sea ice concentration +and sea ice thickness. @@ -34,16 +35,15 @@ Diagnostics are stored in diag_scripts/ (multi-year monthly mean values). * SeaIce_polcon.ncl: polar stereographic plots of sea ice - concentration (= sea ice area fraction) and extent (grid cells with - a sea ice concentration of at least 15%) for individual models or - observational data sets, for Arctic and Antarctic regions with - flexible paneling of the individual plots. The edges of sea ice - extent can be highlighted via an optional red line. + concentration (= sea ice area fraction) and sea ice thickness for + individual models or observational data sets, for Arctic and Antarctic + regions with flexible paneling of the individual plots. The edges of + sea ice extent can be highlighted via an optional red line. * SeaIce_polcon_diff.ncl: polar stereographic plots of sea ice area - concentration difference between individual models and reference - data (e.g., an observational data set) for both Arctic and Antarctic - with flexible paneling of the individual plots. All data are + concentration and thickness difference between individual models and + reference data (e.g., an observational data set) for both Arctic and + Antarctic with flexible paneling of the individual plots. All data are regridded to a common grid (1°x1°) before comparison. @@ -121,7 +121,7 @@ Variables --------- * sic (sea ice, monthly mean, longitude latitude time) - + * sit (sea ice, monthly mean, longitude latitude time) Observations and reformat scripts @@ -137,6 +137,9 @@ Observations and reformat scripts *Reformat script:* reformat_scripts/obs/reformat_obs_HadISST.ncl + * Pan-Arctic Ice Ocean Modelling and Assimilation System (PIOMAS) + + *Reformat script:* reformat_scripts/obs/reformat_obs_PIOMAS.f90 diff --git a/nml/cfg_SeaIce/cfg_SeaIce_NH_sit.ncl b/nml/cfg_SeaIce/cfg_SeaIce_NH_sit.ncl new file mode 100644 index 0000000000..d337d8af72 --- /dev/null +++ b/nml/cfg_SeaIce/cfg_SeaIce_NH_sit.ncl @@ -0,0 +1,37 @@ +diag_script_info = True + +;; Used by: all SeaIce routines +diag_script_info@region = "Arctic" ; "Arctic" or "Antarctic"; entire hemisphere will be evaluated + ; Make sure to specify data for the correct hemisphere in the main nml. +diag_script_info@month = "9" ; A = annual mean, 3 = March, 9 = September +diag_script_info@styleset = "CMIP5" ; "CMIP5", "DEFAULT" + +;; Used by: SeaIce_polcon, SeaIce_polcon_diff, SeaIce_ancyc +diag_script_info@range_option = 1 ; 0 = use each model's whole time range as specified in namelist + ; 1 = use only intersection of all time ranges + +;; Used by: SeaIce_tsline, SeaIce_ancyc +;; see style_FUNCTIONS/style_$project$.ncl for which data shall be included in the statistics +diag_script_info@multi_model_mean = "n" ; "y" = plot multi-model mean & stddev; "n" = don't +diag_script_info@EMs_in_lg = False ; create legend label for each individual ensemble member +diag_script_info@fill_pole_hole = True ; Fill pole hole in data +diag_script_info@legend_outside = False + +;; Used by: SeaIce_polcon, SeaIce_polcon_diff +diag_script_info@contour_extent = "n" ; y = draw a red contour line for sic extent in polar stereographic plots +diag_script_info@max_vert = 1 ; max allowed number of rows on a panel page (vertical) +diag_script_info@max_hori = 1 ; max allowed number of columns on a panel page (horizontal) +diag_script_info@max_lat = -50. ; Antarctic plotted from -90° up to this latitude +diag_script_info@min_lat = 60. ; Arctic plotted from 90° up to this latitude +diag_script_info@showunits = True ; Show units in title +;diag_script_info@PanelTop = 0.99 ; tune down to get full title of uppermost panel row (default 0.99) + +;; Used by: SeaIce_polcon_diff.ncl +diag_script_info@ref_model = "PIOMAS" ; reference model, as specified in annotations -> if the specified string is + ; not found, the routine will print a list of valid strings before crashing +diag_script_info@dst_grid = "./diag_scripts/aux/CDO/cdo_dst_grid_g010" + ; path to destination grid file, required by cdo_remapdis +;diag_script_info@grid_min = -0.3 ; min contour value, default: -1. +;diag_script_info@grid_max = 0.3 ; max contour value, default: 1. +;diag_script_info@grid_step = 0.05 ; step between contours, default: 0.2 +;diag_script_info@grid_center = 0.0 ; value to center the color bar, default: 0.0 diff --git a/nml/namelist_SeaIce.xml b/nml/namelist_SeaIce.xml index d135294493..8ee683d466 100644 --- a/nml/namelist_SeaIce.xml +++ b/nml/namelist_SeaIce.xml @@ -10,7 +10,7 @@ A namelist for plotting SeaIce diagnostics at the Arctic and Antarctic Author Daniel Senftleben (DLR, Germany - Daniel.Senftleben@dlr.de) -Contributor +Contributors Melanie Braeu (DLR, Germany) Klaus-Dirk Gottschaldt (DLR, Germany - Klaus-Dirk.Gottschaldt@dlr.de) @@ -37,7 +37,7 @@ This namelist is part of the ESMValTool 1 False png - D_stroeve07grl, P_esmval, P_crescendo + D_stroeve07grl, P_esmval, P_crescendo @@ -210,12 +210,26 @@ This namelist is part of the ESMValTool CMIP5_ETHZ NorESM1-M OImon historical r3i1p1 1960 2005 @{MODELPATH}/ETHZ_CMIP5/ CMIP5_ETHZ NorESM1-ME OImon historical r1i1p1 1960 2005 @{MODELPATH}/ETHZ_CMIP5/ - - - OBS HadISST reanaly 20130524 1960 2005 @{OBSPATH}/Tier2/HadISST/ + + + Set of NH sit contour and difference plots + ./variable_defs/ + sit + T2Ms + ./nml/cfg_SeaIce/ + R_seaIce, T_seaIce + + OBS_gridfile PIOMAS reanaly 2-1 1978 2017 @{OBSPATH}/Tier2/PIOMAS/ + @{OBSPATH}/Tier2/PIOMAS/OBS_PIOMAS_reanaly_2-1_T2Ms_sit_197801-201712.nc + + SeaIce_polcon.ncl + SeaIce_polcon_diff.ncl + + + Set of NH sic timeline, contour and difference plots ./variable_defs/ @@ -224,6 +238,8 @@ This namelist is part of the ESMValTool ./nml/cfg_SeaIce/ R_seaIce, T_seaIce + OBS HadISST reanaly 20130524 1960 2005 @{OBSPATH}/Tier2/HadISST/ + OBS_gridfile NSIDC-NT sat NH 1979 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-NT_sat_NH_T2Ms_sic_197811-201312.nc OBS_gridfile NSIDC-BT sat NH 1979 2005 @{OBSPATH}/Tier2/NSIDC/ @@ -244,6 +260,8 @@ This namelist is part of the ESMValTool ./nml/cfg_SeaIce/ R_seaIce, T_seaIce + OBS HadISST reanaly 20130524 1960 2005 @{OBSPATH}/Tier2/HadISST/ + OBS_gridfile NSIDC-NT sat SH 1979 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-NT_sat_SH_T2Ms_sic_197811-201312.nc OBS_gridfile NSIDC-BT sat SH 1979 2005 @{OBSPATH}/Tier2/NSIDC/ @@ -254,6 +272,7 @@ This namelist is part of the ESMValTool SeaIce_polcon.ncl SeaIce_polcon_diff.ncl + diff --git a/nml/test_suites/dlr/namelist_SeaIce.xml b/nml/test_suites/dlr/namelist_SeaIce.xml index 152625f2ab..d22ec6370e 100644 --- a/nml/test_suites/dlr/namelist_SeaIce.xml +++ b/nml/test_suites/dlr/namelist_SeaIce.xml @@ -42,10 +42,25 @@ This namelist is part of the ESMValTool CMIP5_ETHZ MPI-ESM-LR OImon historical r1i1p1 2001 2004 @{MODELPATH}/ETHZ_CMIP5/ CMIP5_ETHZ MPI-ESM-MR OImon historical r1i1p1 2002 2005 @{MODELPATH}/ETHZ_CMIP5/ - OBS HadISST reanaly 20130524 1999 2004 @{OBSPATH}/Tier2/HadISST/ + + Set of NH sit contour and difference plots + ./variable_defs/ + sit + T2Ms + ./nml/cfg_SeaIce/ + R_seaIce, T_seaIce + + OBS_gridfile PIOMAS reanaly 2-1 1999 2004 @{OBSPATH}/Tier2/PIOMAS/ + @{OBSPATH}/Tier2/PIOMAS/OBS_PIOMAS_reanaly_2-1_T2Ms_sit_197801-201712.nc + + SeaIce_polcon.ncl + SeaIce_polcon_diff.ncl + + + Set of NH Sea Ice conc. timeline, contour and difference plots ./variable_defs/ @@ -57,9 +72,9 @@ This namelist is part of the ESMValTool SeaIce_polcon.ncl SeaIce_polcon_diff.ncl + OBS HadISST reanaly 20130524 1999 2004 @{OBSPATH}/Tier2/HadISST/ OBS_gridfile NSIDC-NT sat NH 2002 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-NT_sat_NH_T2Ms_sic_197811-201312.nc - OBS_gridfile NSIDC-BT sat NH 2002 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-BT_sat_NH_T2Ms_sic_197811-201312.nc @@ -75,10 +90,10 @@ This namelist is part of the ESMValTool SeaIce_polcon.ncl SeaIce_polcon_diff.ncl - OBS_gridfile NSIDC-NT sat SH 1979 2005 @{OBSPATH}/Tier2/NSIDC/ + OBS HadISST reanaly 20130524 1999 2004 @{OBSPATH}/Tier2/HadISST/ + OBS_gridfile NSIDC-NT sat SH 2002 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-NT_sat_SH_T2Ms_sic_197811-201312.nc - - OBS_gridfile NSIDC-BT sat SH 1979 2013 @{OBSPATH}/Tier2/NSIDC/ + OBS_gridfile NSIDC-BT sat SH 2002 2005 @{OBSPATH}/Tier2/NSIDC/ @{OBSPATH}/Tier2/NSIDC/OBS_NSIDC-BT_sat_SH_T2Ms_sic_197811-201312.nc