Changeset 224 for trunk/SRC/ToBeReviewed/CALCULS
- Timestamp:
- 03/15/07 11:22:28 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/CALCULS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/CALCULS/hdyn.pro
r163 r224 5 5 ; 6 6 ; @file_comments 7 ; Calculate the height by rapport to a reference state for a depth reference. 8 ; See keywords for different possibilities. By default, the state reference 9 ; is rho=1020 and the depth reference is gdepw[ka] with ka the first W level 10 ; directly above 1000 m. 7 ; Calculate the height by rapport to a reference state for a depth reference. 8 ; See keywords for different possibilities. By default, the state reference 9 ; is rho=1020 and the depth reference is gdepw[ka] with ka the first W level 10 ; directly above 1000 m. 11 11 ; 12 12 ; @categories … … 17 17 ; 18 18 ; @param TABTN {in}{required} 19 ; array representing the temperature. Has the same size than SN19 ; array representing the temperature. Has the same size than SN. 20 20 ; 21 ; @keyword GILL We activate this key if we want to calculate the dynamic height 22 ; like in the GILL page 215, which means by rapport to a reference state which 23 ; vary in depth and which is determined by a reference temperature tref at 0°C 24 ; and a reference salinity sref at 35psu 21 ; @keyword GILL 22 ; We activate this key if we want to calculate the dynamic height 23 ; like in the GILL page 215, which means by rapport to a reference state which 24 ; vary in depth and which is determined by a reference temperature tref at 0°C 25 ; and a reference salinity sref at 35 psu. 25 26 ; 26 27 ; @keyword LEVEL 27 ; It is the same reference level to take. This level is defined like 28 ; It is the same reference level to take. This level is defined like 28 29 ; that gdepw[level] is the reference depth 30 ; 31 ; @keyword SREF 32 ; Give a value to this keyword to change the reference salinity used in the 33 ; calculation when GILL is activated. 29 34 ; 30 ; @keyword SREF31 ; Give a value to this keyword to change the reference salinity used in the32 ; calculation when GILL is activated.33 ;34 35 ; @keyword TREF 35 ; Give a value to this keyword to change the reference temperature used in the 36 ; calculation when GILL 37 ; 36 ; Give a value to this keyword to change the reference temperature used in the 37 ; calculation when GILL is activated. 38 ; 38 39 ; @keyword PROFREF 39 ; Give a depth to this keyword which will be considered as the reference depth 40 ; (in this case, LEVEL has not any effect). the calculation will be effectuated 41 ; until this depth effecting an interpolation between the the last W level above 40 ; Give a depth to this keyword which will be considered as the reference depth 41 ; (in this case, LEVEL has not any effect). the calculation will be effectuated 42 ; until this depth effecting an interpolation between the the last W level above 42 43 ; PROFREF and PROFREF. 43 44 ; … … 46 47 ; 47 48 ; @returns 48 ; An array of the same size of sn and tn representing the dynamic height calculated 49 ; An array of the same size of sn and tn representing the dynamic height calculated 49 50 ; from a reference depth nd by rapport to a reference state. 50 51 ; 51 ; @uses 52 ; @uses 52 53 ; common.pro 53 54 ; 54 55 ; @restrictions 55 ; Points for which we can not calculate the dynamic height (whose the batymetry 56 ; Points for which we can not calculate the dynamic height (whose the batymetry 56 57 ; is less deep than the reference depth) are put at the value !values.f_nan 57 58 ; 58 59 ; @restrictions 59 ; approximation: The pressure in decibars is equal to the depth in meters (the pressure increase of 1bar all 10m) 60 ; approximation: The pressure in decibars is equal to the depth in meters 61 ; (the pressure increase of 1 bar every 10 m) 60 62 ; 61 63 ; @history … … 69 71 ;------------------------------------------------------------ 70 72 ;------------------------------------------------------------ 71 FUNCTION hdyn, tabsn, tabtn, TREF = tref,SREF = sref, PROFREF = profref, LEVEL = level, GILL = gill, SURFACE_LEVEL = surface_level73 FUNCTION hdyn, tabsn, tabtn, TREF = tref, SREF = sref, PROFREF = profref, LEVEL = level, GILL = gill, SURFACE_LEVEL = surface_level 72 74 ; 73 75 compile_opt idl2, strictarrsubs … … 85 87 level = level-1 86 88 za = gdepw[level] 87 ENDIF ELSE BEGIN 88 if NOT keyword_set(level) then BEGIN 89 ENDIF ELSE BEGIN 90 if NOT keyword_set(level) then BEGIN 89 91 rien = where(gdepw LE 1000., level) 90 92 level = level-1 … … 92 94 profref = gdepw[level] 93 95 za = profref 94 ENDELSE 96 ENDELSE 95 97 tailles = size(tabsn) 96 98 taillet = size(tabtn) 97 99 if total(tailles[0:tailles[0]] NE taillet[0:taillet[0]]) NE 0 then $ 98 return, report(' Les tableaux sn et tn doivent avoir la meme taille')99 if tailles[3] NE jpk then return, report(' La dim verticale des tableaux sn et tn doit etre egalre ajpk')100 return, report('arrays sn and tn must have the same size') 101 if tailles[3] NE jpk then return, report('vertical dimension of sn and tn arrarrays must be equal to jpk') 100 102 nx = nxt 101 103 ny = nyt 102 104 case (size(tabsn))[0] OF 103 3:BEGIN 105 3:BEGIN 104 106 case 1 of 105 107 tailles[1] eq jpi and tailles[2] eq jpj: BEGIN … … 107 109 tn = tabtn[firstxt:lastxt, firstyt:lastyt, *] 108 110 end 109 tailles[1] eq nx and tailles[2] eq ny:BEGIN 111 tailles[1] eq nx and tailles[2] eq ny:BEGIN 110 112 sn = tabsn 111 113 tn = tabtn … … 128 130 endcase 129 131 END 130 4:BEGIN 132 4:BEGIN 131 133 case 1 of 132 134 tailles[1] eq jpi and tailles[2] eq jpj AND tailles[4] EQ jpt: BEGIN … … 134 136 tn = tabtn[firstxt:lastxt, firstyt:lastyt, *, *] 135 137 end 136 tailles[1] eq nx and tailles[2] eq ny AND tailles[4] EQ jpt:BEGIN 138 tailles[1] eq nx and tailles[2] eq ny AND tailles[4] EQ jpt:BEGIN 137 139 sn = tabsn 138 140 tn = tabtn … … 158 160 endcase 159 161 END 160 ELSE: return, report(' cas non code')162 ELSE: return, report('not implemented') 161 163 ENDCASE 162 164 varunit = 'cm' 163 165 varname = 'Dynamic Height (href='+strtrim(round(profref), 1)+'m)' 164 IF keyword_set(key_performance) THEN print, 'temps hdyn', systime(1)-tempsun 166 IF keyword_set(key_performance) THEN print, 'temps hdyn', systime(1)-tempsun 165 167 166 168 return, hdyn -
trunk/SRC/ToBeReviewed/CALCULS/level2depth.pro
r163 r224 17 17 ; To do not mask land points. 18 18 ; 19 ; @returns 19 ; @returns 20 20 ; 2d array containing depths 21 21 ; … … 50 50 ;--------------------------------------------------------------- 51 51 taille = size(niveaux) 52 if taille[0] NE 2 then return, report(' le champ en entree doit contenir un tableau 2d')52 if taille[0] NE 2 then return, report('input field must be a 2d array') 53 53 case 1 of 54 54 taille[1] eq jpi and taille[2] eq jpj:niveaux=niveaux[firstx:lastx, firsty:lasty] … … 73 73 endif 74 74 ; 75 if keyword_set(key_performance) THEN print, 'temps level2depth', systime(1)-tempsun 75 if keyword_set(key_performance) THEN print, 'temps level2depth', systime(1)-tempsun 76 76 return, gdep 77 77 end -
trunk/SRC/ToBeReviewed/CALCULS/projectondepth.pro
r163 r224 71 71 endcase 72 72 case 1 OF 73 taillearray[3] NE jpk:return, report(' Le tableau 3d doit avoir sa 3eme dimension egale ajpk')73 taillearray[3] NE jpk:return, report('2d array must have its 3d dimension equal to jpk') 74 74 taillearray[1] eq jpi and taillearray[2] eq jpj:array=array[firstx:lastx, firsty:lasty, *] 75 75 taillearray[1] eq nx and taillearray[2] eq ny:
Note: See TracChangeset
for help on using the changeset viewer.