Skip to content

Commit

Permalink
Merge pull request #353 from ESMValGroup/reformat_obs_ERA-NCEP
Browse files Browse the repository at this point in the history
Add auxiliary height coordinate for tas (will be needed in v2)
  • Loading branch information
mattiarighi authored May 23, 2018
2 parents e91ad12 + b66c490 commit e93ee66
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions reformat_scripts/obs/reformat_obs_ERA-Interim.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,30 @@ begin
fout = OUTDIR + "OBS_" + OBSNAME + "_reanaly_1_" + FIELD + \
"_" + VARS(vID) + "_" + YEAR1 + "01-" + YEAR2 + "12.nc"

;; Add height coordinate to tas variable (required by the new backend)
if (VARS(vID).eq."tas") then
output@coordinates = "height"
end if

;; Write variable
write_nc(fout, VARS(vID), output, gAtt)
delete(gAtt)
delete(output)

;; Add height coordinate to tas variable (required by the new backend)
if (VARS(vID).eq."tas") then
height = 2.d
height!0 = "ncl_scalar"
height@units = "m"
height@axis = "Z"
height@positive = "up"
height@long_name = "height"
height@standard_name = "height"
w = addfile(fout, "w")
w->height = height
delete(w)
end if

end do

leave_msg(diag_script, "", 1)
Expand Down
19 changes: 19 additions & 0 deletions reformat_scripts/obs/reformat_obs_NCEP.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,30 @@ begin
fout = OUTDIR + "OBS_" + OBSNAME + "_reanaly_1_" + FIELD + \
"_" + VARS(vID) + "_" + YEAR1 + "01-" + YEAR2 + "12.nc"

;; Add height coordinate to tas variable (required by the new backend)
if (VARS(vID).eq."tas") then
output@coordinates = "height"
end if

;; Write variable
write_nc(fout, VARS(vID), output, gAtt)
delete(gAtt)
delete(output)

;; Add height coordinate to tas variable (required by the new backend)
if (VARS(vID).eq."tas") then
height = 2.d
height!0 = "ncl_scalar"
height@units = "m"
height@axis = "Z"
height@positive = "up"
height@long_name = "height"
height@standard_name = "height"
w = addfile(fout, "w")
w->height = height
delete(w)
end if

end do

leave_msg(diag_script, "", 1)
Expand Down

0 comments on commit e93ee66

Please sign in to comment.