;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; ; This file is part of ICTP RegCM. ; ; ICTP RegCM is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; ICTP RegCM is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MGPPCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with ICTP RegCM. If not, see . ; ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl" begin ;************************* ; read in data ;************************* a = addfile("/run/media/samy/SAMSUNG/RegCM_Final/OBS/seasonal/AFR_DOMAIN000.nc","r") b = a->landuse(:,:) xlat = a->xlat xlon = a->xlon dims = dimsizes(xlat) nlat = dims(0) nlon = dims(1) landsea = a->mask(2:nlon-2,2:nlat-2) c = addfile("/run/media/samy/SAMSUNG/RegCM-CN/RegCM4_CN_modified/CLM4.5/AFR_GPP_MAM.nc","r") d = c->GPP(:,:,:) ;d = d - 2730.15 ;tmx1 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmax_MAM.nc","r") ;tmx11 = tmx1->GPPmax(:,0,:,:) ;tmx11 = tmx11 - 273.15 ;tmn1 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmin_MAM.nc","r") ;tmn11 = tmn1->GPPmin(:,0,:,:) ;tmn11 = tmn11 - 273.15 ;cc = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_rsds_MAM.nc","r") ;dd = cc->rsds(:,:,:) ;dd = dd * 0.0864 ;ET1 = 0.0015 * dd * (d + 17.8) * 0.408 ;ET1 = -0.611 + (0.149*dd) + (0.079*d) ;ET1 = 0.0023 * dd * (d + 17.8) * (tmx11 - tmn11)^0.4 f = addfile("/run/media/samy/SAMSUNG/RegCM-CN/RegCM4_CN_modified/CLM4.5/AFR_GPP_JJA.nc","r") g = f->GPP(:,:,:) ;g = g - 273.15 ;ff = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_rsds_JJA.nc","r") ;gg = ff->rsds(:,:,:) ;gg = gg * 0.0864 ;tmx2 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmax_JJA.nc","r") ;tmx22 = tmx2->GPPmax(:,0,:,:) ;tmx22 = tmx22 - 273.15 ;tmn2 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmin_JJA.nc","r") ;tmn22 = tmn2->GPPmin(:,0,:,:) ;tmn22 = tmn22 - 273.15 ;ET2 = 0.0015 * gg * (g + 17.8) * 0.408 ;ET2 = -0.611 + (0.149*gg) + (0.079*g) ;ET2 = 0.0023 * gg * (g + 17.8) * (tmx22 - tmn22)^0.4 h = addfile("/run/media/samy/SAMSUNG/RegCM-CN/RegCM4_CN_modified/CLM4.5/AFR_GPP_SON.nc","r") i = h->GPP(:,:,:) ;i = i - 273.15 ;hh = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_rsds_SON.nc","r") ;ii = hh->rsds(:,:,:) ;ii = ii * 0.0864 ;tmx3 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmax_SON.nc","r") ;tmx33 = tmx3->GPPmax(:,0,:,:) ;tmx33 = tmx33 - 273.15 ;tmn3 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmin_SON.nc","r") ;tmn33 = tmn3->GPPmin(:,0,:,:) ;tmn33 = tmn33 - 273.15 ;ET3 = 0.0015 * ii * (i + 17.8) * 0.408 ;ET3 = -0.611 + (0.149*ii) + (0.079*i) ;ET3 = 0.0023 * ii * (i + 17.8) * (tmx33 - tmn33)^0.4 j = addfile("/run/media/samy/SAMSUNG/RegCM-CN/RegCM4_CN_modified/CLM4.5/AFR_GPP_DJF.nc","r") k = j->GPP(:,:,:) ;k = k - 273.15 ;jj = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_rsds_DJF.nc","r") ;kk = jj->rsds(:,:,:) ;kk = kk * 0.0864 ;tmx4 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmax_DJF.nc","r") ;tmx44 = tmx4->GPPmax(:,0,:,:) ;tmx44 = tmx44 - 273.15 ;tmn4 = addfile("/run/media/samy/SAMSUNG/Egypt/seasonal/egypt_GPPmin_DJF.nc","r") ;tmn44 = tmn4->GPPmin(:,0,:,:) ;tmn44 = tmn44 - 273.15 ;ET4 = 0.0015 * kk * (k + 17.8) * 0.408 ;ET4 = -0.611 + (0.149*kk) + (0.079*k) ;ET4 = 0.0023 * kk * (k + 17.8) * (tmx44 - tmn44)^0.4 l = addfile("/run/media/samy/SAMSUNG/RegCM_Final/OBS/seasonal/carbon_obs/AFR_GPP_MAM.nc","r") m = l->gpp(:,:,:) m = mask(m,landsea,2) n = addfile("/run/media/samy/SAMSUNG/RegCM_Final/OBS/seasonal/carbon_obs/AFR_GPP_JJA.nc","r") o = n->gpp(:,:,:) o = mask(o,landsea,2) p = addfile("/run/media/samy/SAMSUNG/RegCM_Final/OBS/seasonal/carbon_obs/AFR_GPP_SON.nc","r") q = p->gpp(:,:,:) q = mask(q,landsea,2) r = addfile("/run/media/samy/SAMSUNG/RegCM_Final/OBS/seasonal/carbon_obs/AFR_GPP_DJF.nc","r") s = r->gpp(:,:,:) s = mask(s,landsea,2) t = d t@_FillValue = -9.99e+08 if(any(m.gt.0)) then t = ((d - m)/m) else t = t@_FillValue end if u = g t@_FillValue = -9.99e+08 if(any(o.gt.0)) then u = ((g - o)/o) else u = u@_FillValue end if v = i v@_FillValue = -9.99e+08 if(any(q.gt.0)) then v = ((i - q)/q) else v = v@_FillValue end if w = k w@_FillValue = -9.99e+08 if(any(s.gt.0)) then w = ((k - s)/s) else w = w@_FillValue end if xlat = a->xlat xlon = a->xlon dims = dimsizes(xlat) nlat = dims(0) nlon = dims(1) ;pdims = dimsizes(k) ;pdims = dimsizes(g) ;pdims = dimsizes(c) ;ntimes = pdims(0) ;times = a->time; ;*********************** ; plot ;*********************** plot = new(12,graphic) wks = gsn_open_wks("pdf","GrossPrimaryProduction") gsn_define_colormap(wks,"BlAqGrYeOrRe") ;"hotcold_18lev") res = True ; plot mods desired ;res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels ;res@cnLevels = (/-3.2,-2.8,-2.4,-2.0,-1.6,-1.2,-0.8,-0.4,0.0,0.4,0.8,1.2,1.6,2.0,2.4,2.8,3.2/) res@tiMainFontHeightF = 0.015 ; !!!!! any plot of data that is on a native grid, must use the "corners" ; method of zooming in on map. ;res@tiMainString = "GPP_Nitrification" res@mpLimitMode = "Corners" ; choose range of map res@mpLeftCornerLatF = xlat(0,0) res@mpLeftCornerLonF = xlon(0,0) res@mpRightCornerLatF = xlat(nlon-1,nlat-1) res@mpRightCornerLonF = xlon(nlon-1,nlat-1) ; The following 4 pieces of information are REQUIRED to GPPoperly display ; data on a native grid. This data should be specified somewhere in the ; model itself. prj = a@projection clon = a@longitude_of_projection_origin if (prj .eq. "LAMCON") then trlats = a@standard_parallel res@mpProjection = "LambertConformal" res@mpLambertParallel1F = trlats(0) res@mpLambertParallel2F = trlats(1) res@mpLambertMeridianF = clon end if if (prj .eq. "NORMER") then res@mpProjection = "Mercator" end if if (prj .eq. "POLSTR") then clat = a@latitude_of_projection_origin res@mpProjection = "Stereographic" res@mpRelativeCenterLon = True res@mpCenterLonF = clon res@mpRelativeCenterLat = True res@mpCenterLatF = clat end if if (prj .eq. "ROTMER") then clat = a@latitude_of_projection_origin res@mpProjection = "Mercator" res@mpCenterLonF = clon res@mpCenterLatF = clat end if ; usually, when data is placed onto a map, it is TRANSFORMED to the specified ; projection. Since this model is already on a native lambert conformal grid, ; we want to turn OFF the tranformation. res@tfDoNDCOverlay = True ; do not transform res@cnFillOn = True ; color plot desired res@cnLinesOn = False ; no contour lines res@mpGeophysicalLineColor = "black" ; color of continental outlines res@mpOutlineBoundarySets = "National" ; turn on country boundaries res@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines ;res@pmTickMarkDisplayMode = "Always" ; res@mpGridLineThicknessF = 0.5 ;res@mpGridAndLimbOn = True ; turn on grid lines res@mpGridLatSpacingF = 5.0 ; spacing of grid lat lines res@mpGridLonSpacingF = 5.0 ; spacing of grid lon lines res@mpGridLineDashPattern = 0.5 ; choose dash pattern of lat/lon lines ;res@lbOrientation = "Vertical" ; vertical label bar ;res@lbLabelAutoStride = True res@gsnAddCyclic = False ; regional data don't add res@gsnDraw = False ; don't draw res@gsnFrame = False ; don't advance frame res@pmTickMarkDisplayMode = "Always" ; res@lbLabelBarOn = True ; turn off individual cb's res@cnLevelSelectionMode = "ManualLevels" ;res@cnMinLevelValF = 0 ; set the minimum contour level ;res@cnMaxLevelValF = 6 ; set the maximum contour level ;res@cnLevelSpacingF = 0.5 res@tiMainString = "RegCM-MAM" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(0) = gsn_csm_contour_map(wks,d(0,:,:),res) res@tiMainString = "CARDAMOM-MAM" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(1) = gsn_csm_contour_map(wks,m(0,:,:),res) res@tiMainString = "Diff" res@gsnRightString = "%" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = -1 ; set the minimum contour level res@cnMaxLevelValF = 1 ; set the maximum contour level res@cnLevelSpacingF = 0.1 plot(2) = gsn_csm_contour_map(wks,t(0,:,:),res) res@tiMainString = "RegCM-JJA" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(3) = gsn_csm_contour_map(wks,g(0,:,:),res) res@tiMainString = "CARDAMOM-JJA" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(4) = gsn_csm_contour_map(wks,o(0,:,:),res) res@tiMainString = "Diff" res@gsnRightString = "%" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = -1 ; set the minimum contour level res@cnMaxLevelValF = 1 ; set the maximum contour level res@cnLevelSpacingF = 0.1 plot(5) = gsn_csm_contour_map(wks,u(0,:,:),res) res@tiMainString = "RegCM-SON" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(6) = gsn_csm_contour_map(wks,i(0,:,:),res) res@tiMainString = "CARDAMOM-SON" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(7) = gsn_csm_contour_map(wks,q(0,:,:),res) res@tiMainString = "Diff" res@gsnRightString = "%" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = -1 ; set the minimum contour level res@cnMaxLevelValF = 1 ; set the maximum contour level res@cnLevelSpacingF = 0.1 plot(8) = gsn_csm_contour_map(wks,v(0,:,:),res) res@tiMainString = "RegCM-DJF" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(9) = gsn_csm_contour_map(wks,k(0,:,:),res) res@tiMainString = "CARDAMOM-DJF" res@gsnRightString = "gC/m2/day" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = 0 ; set the minimum contour level res@cnMaxLevelValF = 10 ; set the maximum contour level res@cnLevelSpacingF = 0.5 plot(10) = gsn_csm_contour_map(wks,s(0,:,:),res) res@tiMainString = "Diff" res@gsnRightString = "%" res@gsnLeftString = "GPP" res@cnLevelSelectionMode = "ManualLevels" ; manually set the contour levels with the following 3 resources res@cnMinLevelValF = -1 ; set the minimum contour level res@cnMaxLevelValF = 1 ; set the maximum contour level res@cnLevelSpacingF = 0.1 plot(11) = gsn_csm_contour_map(wks,w(0,:,:),res) resZ = True resZ@gsnMaximize = True resZ@gsnPanelBottom = 0.005 resZ@txString = "GrossPrimaryProduction" resZ@lbLabelFontHeightF = 0.01 ;resZ@gsnPanelLabelBar = True ;resZ@lbLabelAngleF = 90 ; add common colorbar gsn_panel(wks,plot,(/4,3/),resZ) end