metno / emep-ctm

Open Source EMEP/MSC-W model
GNU General Public License v3.0
27 stars 18 forks source link

GridValues_ml.f90 #18

Closed belavicm closed 7 years ago

belavicm commented 7 years ago

Hello,

is there some progress with "subroutine lb2ij_real" in GridValues_ml.f90 with general projection?

...
case default ! general projection, Use only info from glon_fdom and glat_fdom
!first find closest by testing all gridcells.
call StopAll('lb2ij: conversion broken 27 Oct 2015, Peter')
!glon_fdom is no more defined. Could easily rewrite if necessary
...

Is the formula for xr2 and yr2 correct "subroutine lb2ij_real"? I think gb2 and gl2 need to be swaped.

select case (projection)
  case('Stereographic')
    PId4  =PI/4.
    dr2   =dr*0.5   ! degrees to radians /2
    fi_loc=fi
    an_loc=an
    xp_loc=xp
    yp_loc=yp

    if(present(fi2))fi_loc=fi2
    if(present(an2))an_loc=an2
    if(present(xp2))xp_loc=xp2
    if(present(yp2))yp_loc=yp2

    xr2=xp_loc+an_loc*tan(PId4-gb2*dr2)*sin(dr*(gl2-fi_loc))
    yr2=yp_loc-an_loc*tan(PId4-gb2*dr2)*cos(dr*(gl2-fi_loc))
avaldebe commented 7 years ago

Hi @belavicm,

I assigned this questions to Peter (@gitpeterwind). He is the one signing the call StopAll message. Alas, it will take some time for him to answer. Please be patient.

In the mean time, all I can say is that our development version looks equivalent to the open source version.

Cheers, Álvaro.

belavicm commented 7 years ago

xr2 and yr2 are correct, but some comments in lb2ij_real are missleading: gl is long and gb is lat...

In comments they are swapped: subroutine lb2ij_real(gl2,gb2,xr2,yr2,fi2,an2,xp2,yp2) !Note: this routine is not yet CPU optimized !-------------------------------------------------------------------! ! calculates coordinates xr2, yr2 (real values) from gl(lat), gb(long) ...

gitpeterwind commented 7 years ago

You are right about the misleading comment: gb is latitude (Breddegrad) and gl is longitude (Lengdegrad). Thanks for pointing this out! (PS: who are you "belavicm"?)

gitpeterwind commented 7 years ago

"General projection" in this routine, means that the model uses a projection which is not explicitly supported. The supported projections are: Polar stereographic, lon-lat, rotated lon-lat, Lambert comformal It is best (from a performance point of view), to use an explicitly supported projection. Before I consider to try to make the "general projection" case work again, I would like to know if this is really necessary: which projection is used? It may be a better alternative to make the model support this new projection.

belavicm commented 7 years ago

Hello,

My name is Martin Belavić. Since 2016 I am working at Meteorological and Hydrological Service of Croatia, Air Quality Research Department. At our service ALADIN is operational NWP model. I'm using meteorological products from ALADIN (Lambert comformal, 2km, 4km and 8km) for EMEP. Lambert is similar to PS with slightly twiks in the code (new case...) and "general projection" is only for testing.

gitpeterwind commented 7 years ago

Hi Martin, We have now the Lambert conformal case included in the latest versions (not publicly available yet). I can make it available to you if you wish. Just e-mail me at peter.wind@met.no It is true that for testing new projections, the "general case" can still be useful. I will try to repair it (but it will take quite some time before I can find time to do this).