GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — seapodym-codebase/src/SaveTimeArea.cpp at master · PacificCommunity/seapodym-codebase

Expand file tree

/

SaveTimeArea.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
102 lines (85 loc) · 3.6 KB
/

SaveTimeArea.cpp

Copy path

File metadata and controls

executable file
·
102 lines (85 loc) · 3.6 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "SaveTimeArea.h"
//#ifdef _DEBUG
//#undef THIS_FILE
//static char THIS_FILE[]=__FILE__;
//#define new DEBUG_NEW
//#endif
void CSaveTimeArea::SumByArea(const PMap& map, const dmatrix& mask_catch, const dmatrix& mat2d, dvector& sum_area, const dvector cell_area, const int nb_reg, const int nbt)
{
sum_area.initialize();
//double cr_catch = 0.01*max(mask_catch);
double cr_catch = 0.1*nbt;
for (int a=0; a<nb_reg; a++){
for (int i=map.regimin[a]; i<map.regimax[a]; i++){
for (int j=map.regjmin[a]; j<map.regjmax[a]; j++){
if (map.carte(i,j) && mask_catch(i,j)>cr_catch){
sum_area[a] += mat2d[i][j] * cell_area[j];
}
}
}
// total all areas
sum_area[nb_reg] += sum_area[a];
}
}
void CSaveTimeArea::SumByEEZ(const CParam& param, const PMap& map, const DMATRIX& mat2d, DVECTOR& sum_EEZ, const dvector cell_area)
{
sum_EEZ.initialize();
const int nlon = param.nlong;
const int nlat = param.nlat;
for (int i=0; i<nlon; i++)
for (int j=0; j < nlat; j++)
if (map.carte(i,j))
for (int a=0; a< param.nb_EEZ; a++)
if (map.maskEEZ[i][j] == param.EEZ_ID[a])
sum_EEZ[a] += mat2d[i][j] * cell_area[j];
}
double CSaveTimeArea::SumByEEZ(const PMap& map, const int EEZ_ID, const DMATRIX& mat2d, const dvector cell_area, const int nlon, const int nlat)
{
double sum_EEZ = 0.0;
for (int i=0; i<nlon; i++)
for (int j=0; j < nlat; j++)
if (map.carte(i,j))
if (map.maskEEZ[i][j] == EEZ_ID)
sum_EEZ += mat2d[i][j] * cell_area[j];
return sum_EEZ;
}
double CSaveTimeArea::SumByEEZ(const PMap& map, const int EEZ_ID, const DMATRIX& C, const DMATRIX& E, const int nlon, const int nlat)
{
double sum_EEZ = 0.0;
for (int i=0; i<nlon; i++)
for (int j=0; j < nlat; j++)
if (map.carte(i,j))
if (map.maskEEZ[i][j] == EEZ_ID)
if (E[i][j]>0){
sum_EEZ += C[i][j]/E[i][j];
}
return sum_EEZ;
}
double CSaveTimeArea::StdCPUEByEEZ(const PMap& map, const int EEZ_ID, const DMATRIX& C, const DMATRIX& E, const double mean, const int nobs, const int nlon, const int nlat)
{
double sum_EEZ = 0.0;
for (int i=0; i<nlon; i++)
for (int j=0; j < nlat; j++)
if (map.carte(i,j))
if (map.maskEEZ[i][j] == EEZ_ID)
if (E[i][j]>0){
double val = C[i][j]/E[i][j];
sum_EEZ += pow(val-mean,2);
}
double std_var = 0;
if (nobs>1)
std_var = sqrt(sum_EEZ/(nobs-1));
return std_var;
}
int CSaveTimeArea::NobsByEEZ(const PMap& map, const int EEZ_ID, const DMATRIX& E, const int nlon, const int nlat)
{
double sum_EEZ = 0.0;
for (int i=0; i<nlon; i++)
for (int j=0; j < nlat; j++)
if (map.carte(i,j))
if (map.maskEEZ[i][j] == EEZ_ID)
if (E[i][j]>0){
sum_EEZ ++;
}
return sum_EEZ;
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.