Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct CnvMapData *map[3];
struct GridData *grd[3];


int latcnt[36];
int latcnt[46];

struct OptionData opt;

Expand Down Expand Up @@ -112,7 +112,7 @@ int main(int argc,char *argv[])
float latdef=62;

float latref=59;
int nlat=36;
int nlat=46;

float bndstep=5;
int bndnp;
Expand Down
6 changes: 3 additions & 3 deletions codebase/superdarn/src.lib/tk/hmb.1.0/include/map_addhmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

/* the boundary array sizes correspond to the grid within which the HMB boundary
* is searched for when determining the HMB from the data: [24 MLT hours]
* and [36 Geomagnetic Latitudes, ranging from 40 to 76 degrees] */
extern float bndarr[24][36];
extern float lathmb[36];
* and [46 Geomagnetic Latitudes, ranging from 30 to 76 degrees] */
extern float bndarr[24][46];
extern float lathmb[46];

struct hmbtab *load_hmb(FILE *fp);
void make_hmb(void);
Expand Down
24 changes: 12 additions & 12 deletions codebase/superdarn/src.lib/tk/hmb.1.0/src/hmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "map_addhmb.h"

float latref=59;
int nlat=36;
int nlat=46;

float bndarr[24][36];
float lathmb[36];
float bndarr[24][46];
float lathmb[46];

#define HMBSTEP 50

Expand Down Expand Up @@ -104,7 +104,7 @@ struct hmbtab *load_hmb(FILE *fp)
ptr->time=realloc(ptr->time,sizeof(double)*cnt);
ptr->median=realloc(ptr->median,sizeof(float)*cnt);
ptr->actual=realloc(ptr->actual,sizeof(float)*cnt);

return ptr;
}

Expand Down Expand Up @@ -137,7 +137,7 @@ void add_hmb_grd(float latmin,int yr,int yrsec,struct CnvMapData *map,

/* We should do something about the hemisphere here */

for (lat=latmin+0.5;lat<90;lat++) {
for (lat=latmin+0.5;lat<90;lat++) {
nlon=(int) (360*cos(lat*PI/180)+0.5);
lstp=360.0/nlon;

Expand All @@ -157,9 +157,9 @@ void add_hmb_grd(float latmin,int yr,int yrsec,struct CnvMapData *map,
bfac=(90-latmin)/(90-latref);
del_L=bfac*5.5;
latx=latmin;
if ((mlt>=11) && (mlt<=19))
if ((mlt>=11) && (mlt<=19))
latx=latmin+del_L*(1+cos((PI/8)*(mlt-11)));
else if ((mlt<11) && (mlt>=5))
else if ((mlt<11) && (mlt>=5))
latx=latmin+del_L*(1+cos((PI/6)*(11-mlt)));

if (lat<=latx) {
Expand All @@ -172,7 +172,7 @@ void add_hmb_grd(float latmin,int yr,int yrsec,struct CnvMapData *map,

off=map->num_model;
map->num_model+=c;
if (map->model==NULL)
if (map->model==NULL)
map->model=malloc(sizeof(struct GridGVec)*map->num_model);
else map->model=realloc(map->model,sizeof(struct GridGVec)*map->num_model);

Expand Down Expand Up @@ -207,7 +207,7 @@ void make_hmb()

mlt=m;

lathmb[n]=n+40.0; /* The +40.0 means we start making the grid used by the iterative HMB-finding algorithm at geomagnetic latitude of 40 degrees. */
lathmb[n]=n+30.0; /* The +30.0 means we start making the grid used by the iterative HMB-finding algorithm at geomagnetic latitude of 30 degrees. */
latmin=lathmb[n];

bfac=(90-latmin)/(90-latref);
Expand Down Expand Up @@ -263,12 +263,12 @@ void map_addhmb(int yr, int yrsec, struct CnvMapData *map, int bndnp,
if (map->hemisphere==1) {
if ((mlt>=11) && (mlt<=19))
map->bnd_lat[i]=latmin+del_L*(1+cos((PI/8)*(mlt-11)));
else if ((mlt<11) && (mlt>=5))
else if ((mlt<11) && (mlt>=5))
map->bnd_lat[i]=latmin+del_L*(1+cos((PI/6)*(11-mlt)));
} else {
if ((mlt>=11) && (mlt<=19))
if ((mlt>=11) && (mlt<=19))
map->bnd_lat[i]=-latmin-del_L*(1+cos((PI/8)*(mlt-11)));
else if ((mlt<11) && (mlt>=5))
else if ((mlt<11) && (mlt>=5))
map->bnd_lat[i]=-latmin-del_L*(1+cos((PI/6)*(11-mlt)));
}

Expand Down
Loading