[14] | 1 | ;+ |
---|
| 2 | ; |
---|
[40] | 3 | ; .. _oaflux_mask_30n30s.pro: |
---|
[14] | 4 | ; |
---|
[67] | 5 | ; ====================== |
---|
| 6 | ; oaflux_mask_30n30s.pro |
---|
| 7 | ; ====================== |
---|
[14] | 8 | ; |
---|
[18] | 9 | ; Produce a NetCDF file with OAFLUX mask over global tropical oceans (30N-30S) |
---|
[17] | 10 | ; |
---|
[18] | 11 | ; .. note:: |
---|
[14] | 12 | ; |
---|
[18] | 13 | ; Longitude range [30.5,379.5] was choosen in order not to make any cut in |
---|
| 14 | ; the Atlantic Ocean. |
---|
| 15 | ; Otherwise if we choose longitude range to [0.5,359.5], Atlantic Ocean |
---|
| 16 | ; will be split to two and will appear on right and left sides of the map. |
---|
[14] | 17 | ; |
---|
[18] | 18 | ; .. graphviz:: |
---|
[14] | 19 | ; |
---|
[40] | 20 | ; digraph oaflux_mask_30n30s { |
---|
[18] | 21 | ; graph [ |
---|
| 22 | ; rankdir="LR", |
---|
| 23 | ; ] |
---|
[50] | 24 | ; file_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lh_oaflux_2004.nc"]; |
---|
| 25 | ; mask [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/mask_oaflux_30N30S.nc"]; |
---|
[14] | 26 | ; |
---|
[40] | 27 | ; oaflux_mask_30n30s [shape=box, |
---|
[18] | 28 | ; fontname=Courier, |
---|
| 29 | ; color=blue, |
---|
[40] | 30 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/oaflux_mask_30n30s.pro", |
---|
[50] | 31 | ; label="${PROJECT}/src/oaflux_mask_30n30s.pro"]; |
---|
[14] | 32 | ; |
---|
[40] | 33 | ; {file_oaflux} -> {oaflux_mask_30n30s} -> {mask} |
---|
[18] | 34 | ; |
---|
| 35 | ; } |
---|
| 36 | ; |
---|
[14] | 37 | ; SEE ALSO |
---|
| 38 | ; ======== |
---|
| 39 | ; |
---|
[18] | 40 | ; :ref:`guide Gather data <gather_data>` |
---|
| 41 | ; |
---|
[15] | 42 | ; :ref:`guide data OAFLUX <data_in_oaflux>` |
---|
[14] | 43 | ; |
---|
[50] | 44 | ; :ref:`project_profile.sh` |
---|
| 45 | ; :ref:`project_init.pro` |
---|
| 46 | ; :ref:`cm_project.pro` |
---|
[17] | 47 | ; |
---|
[19] | 48 | ; :ref:`get_oaflux.sh` |
---|
| 49 | ; |
---|
[18] | 50 | ; :func:`report <saxo:report>` |
---|
| 51 | ; :func:`initncdf <saxo:initncdf>` |
---|
| 52 | ; :func:`ncdf_lec <saxo:ncdf_lec>` |
---|
[20] | 53 | ; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` |
---|
[18] | 54 | ; :func:`isadirectory <saxo:isadirectory>` |
---|
[19] | 55 | ; :func:`isafile <saxo:isafile>` |
---|
[17] | 56 | ; |
---|
[19] | 57 | ; :ref:`TropFlux_19890101_20091231.pro` |
---|
| 58 | ; :ref:`interp_erai_dewt_1989_2009.pro` |
---|
| 59 | ; :ref:`interp_erai_lwr_1989_2009.pro` |
---|
| 60 | ; :ref:`interp_erai_sst_1989_2009.pro` |
---|
| 61 | ; :ref:`interp_erai_t2m_1989_2009.pro` |
---|
| 62 | ; :ref:`interp_erai_ws_1989_2009.pro` |
---|
| 63 | ; :ref:`interp_olr_30n30s_1989_2009.pro` |
---|
| 64 | ; |
---|
[14] | 65 | ; EXAMPLES |
---|
| 66 | ; ======== |
---|
| 67 | ; |
---|
| 68 | ; :: |
---|
| 69 | ; |
---|
[40] | 70 | ; IDL> oaflux_mask_30n30s |
---|
[14] | 71 | ; |
---|
| 72 | ; TODO |
---|
| 73 | ; ==== |
---|
| 74 | ; |
---|
[17] | 75 | ; SAXO new (keep compatibility false) |
---|
[14] | 76 | ; |
---|
| 77 | ; coding rules |
---|
| 78 | ; |
---|
[17] | 79 | ; pro -> function |
---|
| 80 | ; |
---|
[18] | 81 | ; NetCDF CF (may be area_type) |
---|
| 82 | ; |
---|
[17] | 83 | ; global attributes corrections : |
---|
| 84 | ; - written now : OAFLUX mask over the Indian Ocean: 40E-120E, 30S-30N |
---|
| 85 | ; - while data latitude=[-29.5,+29.5] longitude=[30.5,379.5] |
---|
| 86 | ; |
---|
| 87 | ; KNOWN ISSUES |
---|
| 88 | ; ============ |
---|
| 89 | ; |
---|
| 90 | ; test of existence of fullfilename_in not very efficient because |
---|
[19] | 91 | ; MUST_EXIST keyword of :func:`isafile <saxo:isafile>` not yet implemented |
---|
[17] | 92 | ; |
---|
[14] | 93 | ; EVOLUTIONS |
---|
| 94 | ; ========== |
---|
[40] | 95 | ; |
---|
[67] | 96 | ; $Id$ |
---|
[14] | 97 | ; |
---|
[40] | 98 | ; - fplod 20110411T140133Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 99 | ; |
---|
[50] | 100 | ; * usage of tropflux_init and cm_project |
---|
[40] | 101 | ; * replace 30N30S by 30n30s |
---|
| 102 | ; |
---|
[17] | 103 | ; - fplod 20101217T081915Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 104 | ; |
---|
[50] | 105 | ; * remove hard coded directory - usage of ${PROJECT_ID} and ${PROJECT_OD} |
---|
[17] | 106 | ; * add IO test |
---|
| 107 | ; |
---|
[14] | 108 | ; - fplod 20101216T141137Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 109 | ; |
---|
| 110 | ; * minimal header |
---|
| 111 | ; |
---|
| 112 | ; - jv 2010 |
---|
| 113 | ; |
---|
| 114 | ; * creation |
---|
| 115 | ; |
---|
| 116 | ;- |
---|
| 117 | ; |
---|
[40] | 118 | PRO oaflux_mask_30n30s |
---|
[17] | 119 | ; |
---|
[40] | 120 | @cm_4cal |
---|
| 121 | @cm_4data |
---|
| 122 | @cm_4mesh |
---|
| 123 | @cm_4data |
---|
[50] | 124 | @cm_project |
---|
[40] | 125 | |
---|
[17] | 126 | ; check for input file |
---|
| 127 | ; build input filename |
---|
| 128 | yyyy=2004 |
---|
| 129 | cy=string(yyyy,format='(i4.4)') |
---|
| 130 | filename_in='lh_oaflux_'+cy+'.nc' |
---|
| 131 | ; |
---|
| 132 | ; check if this file exists |
---|
[50] | 133 | fullfilename_in = isafile(project_id_env + filename_in, NEW=0, /MUST_EXIST) |
---|
[17] | 134 | IF fullfilename_in[0] EQ '' THEN BEGIN |
---|
| 135 | msg = 'eee : the file ' + fullfilename_in + ' was not found.' |
---|
| 136 | ras = report(msg) |
---|
| 137 | STOP |
---|
| 138 | ENDIF |
---|
| 139 | ; |
---|
| 140 | ; |
---|
[50] | 141 | fullfilename_out=project_od_env+'mask_oaflux_30N30S.nc' |
---|
[17] | 142 | ; in order to avoid unexpected overwritten |
---|
| 143 | IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN |
---|
| 144 | msg = 'eee : the file ' + fullfilename_out + ' already exists.' |
---|
| 145 | ras = report(msg) |
---|
| 146 | STOP |
---|
| 147 | ENDIF |
---|
| 148 | ; |
---|
| 149 | ; Read oaflux grid and mask |
---|
| 150 | initncdf, fullfilename_in |
---|
| 151 | lh=ncdf_lec(fullfilename_in,var='lhtfl',count=[jpi,jpj,1]) & lh=float(lh) |
---|
[13] | 152 | valmask=1.e20 |
---|
| 153 | ind=where(lh ge 32000,compl=nind) & lh(ind)=valmask & lh(nind)=-0.1*lh(nind) |
---|
| 154 | mask_out=(lh ne valmask) |
---|
| 155 | domdef, 0.,360.,-30.,30. |
---|
| 156 | |
---|
| 157 | lon=reform(glamt(*,0)) |
---|
| 158 | ind1=where(lon le 20.) |
---|
| 159 | ind2=where(lon ge 30.) |
---|
| 160 | |
---|
| 161 | lat_out=reform(gphit(0,firstyt:lastyt)) |
---|
| 162 | |
---|
| 163 | lon_out=[reform(glamt(ind2,0)),reform(glamt(ind1,0))+360] |
---|
| 164 | |
---|
| 165 | mask_out=mask_out([ind2,ind1],firstyt:lastyt)*1. |
---|
| 166 | |
---|
[17] | 167 | ncfile='!'+fullfilename_out |
---|
[13] | 168 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 169 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 170 | msk_attr={long_name:'land sea mask',short_name:'msk',axis:'YX'} |
---|
| 171 | globattr={description:'OAFLUX mask over the Indian Ocean: 40E-120E, 30S-30N'} |
---|
| 172 | |
---|
| 173 | ncfields = 'msk[longitude,latitude]=mask_out:msk_attr; ' $ |
---|
| 174 | + 'longitude[]=lon_out:lon_attr; ' $ |
---|
| 175 | + 'latitude[]=lat_out:lat_attr; ' $ |
---|
| 176 | + ' @ globattr' |
---|
| 177 | |
---|
| 178 | @ncdf_quickwrite |
---|
| 179 | |
---|
| 180 | END |
---|