Skip to content
Snippets Groups Projects
Commit 90c6b3bf authored by Paul Gierz's avatar Paul Gierz
Browse files

Update to ensure that mesh resolution is constant in northern high latitudes

parent f59eed63
No related branches found
No related tags found
No related merge requests found
...@@ -2153,13 +2153,16 @@ int triunsuitable(triorg, tridest, triapex, area) ...@@ -2153,13 +2153,16 @@ int triunsuitable(triorg, tridest, triapex, area)
   
//**************************************************************************** //****************************************************************************
// PG: Adds new code to ensure that the transition north of 48 remains constant
//
res_max = 83000.; // 50km //80000.; res_max = 83000.; // 50km //80000.;
//res_satl = 120000.; // 20dg S -- 50dg N in Atlantic //res_satl = 120000.; // 20dg S -- 50dg N in Atlantic
//res_natl = 40000.; // Around Greenland //res_natl = 40000.; // Around Greenland
//res_pac = 100000.; // 50dg N of pacific //res_pac = 100000.; // 50dg N of pacific
//res_arc = 40000.; // Arctic // PG: Uncomment this line for transition North of 48 to remain constant
res_arc = 40000.; // Arctic
//res_arc2= 15200.; //res_arc2= 15200.;
res_hud = 41000.; // FS (old:Hudson Bay) res_hud = 41000.; // FS (old:Hudson Bay)
...@@ -2187,14 +2190,17 @@ int triunsuitable(triorg, tridest, triapex, area) ...@@ -2187,14 +2190,17 @@ int triunsuitable(triorg, tridest, triapex, area)
//res_bg = (250000.0*cos(triorg_ll[1]*PI/180.0) > res_max) ? (250000.0*cos(triorg_ll[1]*PI/180.0)) : res_max; //res_bg = (250000.0*cos(triorg_ll[1]*PI/180.0) > res_max) ? (250000.0*cos(triorg_ll[1]*PI/180.0)) : res_max;
// PG: This line can stay the same based on Qiang's email
res_bg = (185000.0*cos(triorg_ll[1]*PI/180.0) > res_max) ? (185000.0*cos(triorg_ll[1]*PI/180.0)) : res_max; res_bg = (185000.0*cos(triorg_ll[1]*PI/180.0) > res_max) ? (185000.0*cos(triorg_ll[1]*PI/180.0)) : res_max;
   
   
if ( if (
// PG: Here you can specify rules for the MESH resolution
   
( le>res_bg ) || ( le>res_bg ) ||
( dist_cst<2.0 && le>res_bg/((4.0-dist_cst)/2.0)) || // coastline ( dist_cst<2.0 && le>res_bg/((4.0-dist_cst)/2.0)) || // coastline
// PG: Add this from Qiang's email
( le>res_arc && triorg_ll[1]>50) || // north of 50 degree (both Pacific and Atlantic)
//( inpoly_satl && le>res_satl ) || // south atlantic //( inpoly_satl && le>res_satl ) || // south atlantic
//( inpoly_satl==0 && dist_satl<12. && le>(res_satl+(res_bg-res_satl)*dist_satl/12)) || //( inpoly_satl==0 && dist_satl<12. && le>(res_satl+(res_bg-res_satl)*dist_satl/12)) ||
...@@ -2212,7 +2218,8 @@ int triunsuitable(triorg, tridest, triapex, area) ...@@ -2212,7 +2218,8 @@ int triunsuitable(triorg, tridest, triapex, area)
//( le>res_arc && triorg_ll[1]>50 && triorg_ll[0]<50 && triorg_ll[0]>-100 && inpoly_hud==0) || //( le>res_arc && triorg_ll[1]>50 && triorg_ll[0]<50 && triorg_ll[0]>-100 && inpoly_hud==0) ||
//( le>res_arc && triorg_ll[1]>50 && inpoly_hud==0) || // north of 50 degree (both Pacific and Atlantic) //( le>res_arc && triorg_ll[1]>50 && inpoly_hud==0) || // north of 50 degree (both Pacific and Atlantic)
//( triorg_ll[1]<50 && le>(res_arc+(res_bg-res_arc)*(50.-triorg_ll[1])/8.) ) || // transition from big-arctic region (50dgN) to the south to b.g. res. // PG: Turn on the next line from Qiang's email
( triorg_ll[1]<50 && le>(res_arc+(res_bg-res_arc)*(50.-triorg_ll[1])/8.) ) || // transition from big-arctic region (50dgN) to the south to b.g. res.
//( le>res_arc2 && triorg_ll[1]>52) || // north of 52 degree (both Pacific and Atlantic) //( le>res_arc2 && triorg_ll[1]>52) || // north of 52 degree (both Pacific and Atlantic)
//( triorg_ll[1]<52 && le>(res_arc2+( (res_arc+(res_bg-res_arc)*(50.-triorg_ll[1])/8.) -res_arc2)*(52.-triorg_ll[1])/4.) ) || //( triorg_ll[1]<52 && le>(res_arc2+( (res_arc+(res_bg-res_arc)*(50.-triorg_ll[1])/8.) -res_arc2)*(52.-triorg_ll[1])/4.) ) ||
...@@ -2247,7 +2254,14 @@ int triunsuitable(triorg, tridest, triapex, area) ...@@ -2247,7 +2254,14 @@ int triunsuitable(triorg, tridest, triapex, area)
   
( inpoly_hud && le>res_hud ) || // FS (old:hudson bay) ( inpoly_hud && le>res_hud ) || // FS (old:hudson bay)
( inpoly_hud==0 && dist_hud<2 && le>(res_hud+(res_bg-res_hud)*dist_hud/2) ) || ( inpoly_hud==0 && dist_hud<2 && le>(res_hud+(res_bg-res_hud)*dist_hud/2) ) ||
// PG: Next two checks are from Qiangs email also
// equator
(abs(triorg_ll[1])<=15. &&
le>(185000.0-(185000.0-62000.0)*(15.0-abs(triorg_ll[1]))/15.)*cos(triorg_ll[1]*PI/180.0)) ||
//coastline
( dist_cst<2.0 && le>res_bg/((4.0-dist_cst)/2.0)) || // coastline
// PG END
//( triorg_ll[0]<50 && triorg_ll[0]>-100 && triorg_ll[1]>40 && triorg_ll[1]<50 && //( triorg_ll[0]<50 && triorg_ll[0]>-100 && triorg_ll[1]>40 && triorg_ll[1]<50 &&
// le>(res_arc+(res_satl-res_arc)*(50-triorg_ll[1])/10) ) // || // transition atlantic // le>(res_arc+(res_satl-res_arc)*(50-triorg_ll[1])/10) ) // || // transition atlantic
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment