- 积分
- 560
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2024-6-2
- 最后登录
- 1970-1-1
|
begin
;************************************************
; read in netCDF file
;************************************************
a = addfile("180ma.cam.h0.0001-01.nc","r")
;************************************************
; read in zonal winds
;************************************************
t = a->TS(0,:,:) ; read July zonal winds
;************************************************
; reshape the data to 2D if needed
;************************************************
; Assuming TS is a 4D array (time, lev, lat, lon), you can reshape it to 2D
; by selecting a specific time step and flattening the lat and lon dimensions.
; If TS is already 2D, you can skip this step.
; t = reshape(t, dims(1), dims(2)) ; reshape t to be 2D
;************************************************
; create plot
;************************************************
wks = gsn_open_wks("png","Surface_temperature") ; send graphics to PNG file
res = True
res@mpProjection = "Mollweide" ; choose projection
res@mpGridAndLimbOn = True ; turn on lat/lon lines
res@mpPerimOn = False ; turn off box around plot
res@mpGridLatSpacingF = 30. ; spacing for lat lines
res@mpGridLonSpacingF = 30. ; spacing for lon lines
res@mpFillOn = False
res@cnFillOn = True ; color plot desired
res@cnFillPalette = "gui_default" ; set color map
res@cnLineLabelsOn = False ; turn off contour lines
res@txFontHeightF = 0.015
res@vpXF = 0.1 ; make plot bigger
res@vpYF = 0.9
res@vpWidthF = 0.8
res@vpHeightF = 0.8
res@lbLabelFontHeightF = 0.015 ; label bar font height
res@tiMainString = "Example of Mollweide Projection" ; add a title
res@tiMainFontHeightF = .018 ; font height
; Turn off the boundary outlines of the modern map
res@mpOutlineOn = False ; turn off the boundary outlines
res@mpLandFillColor = "white" ; set land fill color to white or transparent
res@mpOceanFillColor = "lightblue" ; set ocean fill color
contour = gsn_csm_contour_map(wks,t,res) ; create the plot
end |
|