;--------------------------------------------------- ; INTERPOLATION INITIALISATIONS * ;--------------------------------------------------- @common_interp ; ; 1. General information concerning the interpolation ; =================================================== ; ; 1.1. Dimension of the field being interpolated (2D or 3D) ; --------------------------------------------------------- ; 2D field --> ndim = 0 ; 3D field --> ndim = 1 ndim = 0 ; Case ndim = 0 ; -if the field and mask are really 2D (x,y(,t)) then ; key_2d = 1 ; -else if they are (x,y,z_a(,t)) where z_a=1 then ; key_2d = 0 key_2d = 1 ; ; 1.2. Nature of the field being interpolated (scalar ou vector) ; -------------------------------------------------------------- ; scalar --> nscal = 0 ; vector --> nscal = 1 nscal = 0 ;nscal = 1 ; ; 1.3. Type of interpolation needed (bilinear ou bicubic) ; ------------------------------------------------------- ; bilinear --> ninterp = 0 ; bicubic --> ninterp = 1 ninterp = 0 ;ninterp = 1 ; ; 1.4. Mask on points ; ------------------- ; key_mask = 1 if some points are masked ; = 0 if no masked points ; key_mask = 0 ; ; 1.5. Maximum iteration number for extrapolation ; ----------------------------------------------- ; nfil = 100 ; ; 1.6. Frequency of drawing : every ndraw time iterations ; ------------------------- ; keydraw = 0 ; =0 if no drawing =1 else key_ps = 0 ; =0 if no Postscript file wanted =1 if PS wanted (implies keydraw=1) ndraw = 1 nlevel = 33 ; every nlevel levels ; ; 2. Information about the data file ; ================================== ; ; 2.1. Fields names ; ----------------- ; ... data IF keyword_set(nscal) THEN BEGIN data_u_name = 'stress_x' data_v_name = 'stress_y' ENDIF ELSE BEGIN ; data_name = 'cond_sed' data_name = 'Br' ENDELSE ; ... units units = "siemens" ; ... input grid mask IF keyword_set(key_mask) THEN mask_name = 'tmask' ; Input Latitude Axis IF keyword_set(nscal) THEN BEGIN y_axis_u = 'nav_lat' y_axis_v = 'nav_lat' ENDIF ELSE BEGIN y_axis = 'la' ENDELSE ; ... input grid depth (3D field only) IF keyword_set(ndim) THEN BEGIN datadept_name = 'deptht' ; ... location (ndep =1 if depth in data file, =0 if in mask file) ndep = 1 ENDIF ; ... time time_name = 'lo' ; ... output grid mask(s) IF keyword_set(nscal) THEN BEGIN mask_u_name = 'umask' mask_v_name = 'vmask' ENDIF ELSE BEGIN mask_t_name = 'tmask' ENDELSE ; ... output grid depth IF keyword_set(ndim) THEN outdept_name = 'gdept' ; ... output grid coordinates IF keyword_set(nscal) THEN BEGIN lon_u_name = 'glamu' lat_u_name = 'gphiu' lon_v_name = 'glamv' lat_v_name = 'gphiv' lon_f_name = 'glamf' lat_f_name = 'gphif' ENDIF ELSE BEGIN lon_name = 'nav_lon' lat_name = 'nav_lat' ENDELSE ; ... missing value ; ; nmiss = 0 --> no missing value ; nmiss = 1 --> missing value of value missing_val ; CAUTION : missing_val stands for the ABSOLUTE VALUE of your ; input file missing value. Please enter missing_val LOWER THAN ; THE ABSOLUTE VALUE of the Missing value of your file. nmiss = 0 missing_val = 85 ; ; 2.2. Spatial resolution ; ----------------------- ; jpiatm = 360l ; l for long integer PLEASE LEAVE IT jpjatm = 180l ; l for long integer PLEASE LEAVE IT jpkatm = 1l ; l for long integer PLEASE LEAVE IT dx = 1. ; Grid size along x axis of the input regular grid south_lat = -89.5 ; Southernmost latitude of the input grid lon_shift= 180 ; Use lon_shift in order to have both input and output grid calculating longitudes the same way (-180 to 180, or, 0 to 360), this will avoid you a lot of problems west_lon = -179.5 ; Longitude at the left handside of the input grid, once lon_shift has been used north_pole = 1 ; Is the upper line of the domain at a latitude of +90 degrees, 1 = yes, 0 = no ; ; 2.3. Temporal resolution ; ------------------------ ; nit000 = 1 ; first time step nitend = 1 ; last time step nstep = nitend-nit000+1 ; number of steps ; ; 2.4. Pretreatment of input variables ; ------------------------------------ ; data = data*scale_factor + add_offset ; when handling multiple files with scale_factor and ; add_offset defined, put key_vari=1 in case they change ; from one file to another ; key_vari = 0 scale_factor = 1. add_offset = 0. ; ; if mask equal -1 on unmasked point --> negmask = 1 ; if mask equal +1 on unmasked point --> negmask = 0 ; negmask = 0 ; ; latitudes from south to north --> reverse = 0 ; latitudes from north to south --> reverse = 1 ; nreverse = 1 ; ; mask = 1 on OCEAN points --> invmask = 0 ; mask = 1 on LAND points --> invmask = 1 ; invmask = 0 ; ; No change on mask extension --> extend = 0 ; Extend mask over one point on ocean points --> extend = 1 ; NB: ONLY 2D FIELDS ALLOWED ; extend = 0 ; ; 3. Information about the output grid ; ==================================== ; ; ... coordinates names ; ; jpioce : number of longitude points ; jpjoce : number of latitude points ; jpkoce : number of vertical levels ; jpioce = 182l ; l for long integer PLEASE LEAVE IT jpjoce = 149l ; l for long integer PLEASE LEAVE IT jpkoce = 1l ; l for long integer PLEASE LEAVE IT pres_x=2. ; Precision of the output grid along x axis pres_y=2. ; Precision of the output grid along y axis ext_x=40 ; Number of extension point on the output grid to treat for E/W boundary conditions ext_y=40 ; Number of extension point on the output grid to treat for North fold boundary conditions; ; modlam --> 0 if all longitudes are lower than 360 degrees ; --> 1 if some longitudes are greater than 360 degrees ; modlam = 0 ; ; 4. Title(s) of output file(s) ; ============================= ; IF keyword_set(nscal) THEN BEGIN long_x_name = 'Zonal wind stress' title_x = "Daily interpolated OMIP stress x wind on ORCA2 grid" long_y_name = 'Meridional wind stress' title_y = "Daily interpolated OMIP stress y wind on ORCA2 grid" ENDIF ELSE BEGIN long_name = 'Salinity' title = "Monthly Levitus Sea Salinity corrected" ENDELSE ; key_performance = 0 ; printf, 40, '' printf, 40, 'Field''s dimension :' IF keyword_set(ndim) THEN printf, 40, ' --> 3D' ELSE printf, 40, ' --> 2D' ; IF keyword_set(nscal) THEN BEGIN printf, 40, 'Interpolation of the vector array : ' printf, 40, ' --> ', '[', data_u_name, ',', data_v_name, ']' ENDIF ELSE BEGIN printf, 40, 'Interpolation of the scalar array : ' printf, 40, ' --> ', data_name ENDELSE ; printf, 40, 'Type of the interpolation :' IF keyword_set(ninterp) THEN printf, 40, ' --> bicubic' $ ELSE printf, 40, ' --> bilinear' ;