GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — seapodym-codebase/src/fd_total_pop.cpp at master · PacificCommunity/seapodym-codebase Expand file tree/ Copy pathfd_total_pop.cppMore file actions executable file ·114 lines (97 loc) · 3.68 KB / Copy pathfd_total_pop.cppFile metadata and controlsexecutable file ·114 lines (97 loc) · 3.68 KB 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 103 104 105 106 107 108 109 110 111 112 113 114 #include "SeapodymCoupled.h" #include <fvar.hpp> /* //simple total_pop function void SeapodymCoupled::Total_Pop_comp(dvar_matrix& total_pop, const int sp, const int jday, const int t_count) { total_pop.initialize(); for (int a=param->sp_a0_adult[sp]; a < param->sp_nb_cohorts[sp]; a++){ for (int i = map.imin; i <= map.imax; i++){ const int jmin = map.jinf[i]; const int jmax = map.jsup[i]; for (int j = jmin; j <= jmax; j++){ if (map.carte(i,j)){ double total_pr = value(total_pop(i,j)); total_pop.elem_value(i,j) = total_pr + value(mat.dvarDensity(sp,a,i,j)); } } } } } */ void SeapodymCoupled::Total_Pop_comp(dvar_matrix& total_pop, const int sp, const int jday, const int t_count) { total_pop.initialize(); for (int a=param->sp_a0_adult[sp]+1; a < param->sp_nb_cohorts[sp]; a++){ int age_adult_habitat = a; for (int aa=a; aa>1; aa--){ if (param->age_compute_habitat(sp,aa-1)!=param->age_compute_habitat(sp,aa)){ age_adult_habitat = aa; break; } } for (int i = map.imin; i <= map.imax; i++){ const int jmin = map.jinf[i]; const int jmax = map.jsup[i]; for (int j = jmin; j <= jmax; j++){ if (map.carte(i,j)){ double access0 = value(mat.dvarZ_access(0,age_adult_habitat,i,j)); double total_pr = value(total_pop(i,j)); total_pop.elem_value(i,j) = total_pr + access0*value(mat.dvarDensity(sp,a,i,j)); } } } } } void SeapodymCoupled::SpawningBiomass_comp(dvar_matrix& total_pop, const int sp) { total_pop.initialize(); dvector maturity_age = param->maturity_age[sp]; for (int a=param->age_mature[sp]; a < param->sp_nb_cohorts[sp]; a++){ for (int i = map.imin; i <= map.imax; i++){ const int jmin = map.jinf[i]; const int jmax = map.jsup[i]; for (int j = jmin; j <= jmax; j++){ if (map.carte(i,j)){ double total_pr = value(total_pop(i,j)); total_pop.elem_value(i,j) = total_pr + maturity_age[a] * value(mat.dvarDensity(sp,a,i,j)); } } } } } void SeapodymCoupled::Total_Stock_comp(dvariable& total_stock, const int sp) { const double area = 1.852*deltaX*1.852*deltaY; const double lonmin_stock_area = param->stock_lonmin[sp]; const double lonmax_stock_area = param->stock_lonmax[sp]; const double latmin_stock_area = param->stock_latmin[sp]; const double latmax_stock_area = param->stock_latmax[sp]; int imin = param->lontoi(lonmin_stock_area); int imax = param->lontoi(lonmax_stock_area)-1;//-1 to match regional computations (see SumQArea) if (imin<map.imin) imin = map.imin; if (imax>map.imax) imax = map.imax; int jmin_stock_area = param->lattoj(latmax_stock_area); int jmax_stock_area = param->lattoj(latmin_stock_area)-1; if (jmin_stock_area<map.jmin) jmin_stock_area = map.jmin; if (jmax_stock_area>map.jmax) jmax_stock_area = map.jmax; int nbstoskip = param->nbsteptoskip; int nbt = nbt_total-nbstoskip; for (int a=param->sp_a0_adult[sp]; a < param->sp_nb_cohorts[sp]; a++){ double Total_Stock = value(total_stock); const double W_mt = param->weight[sp][a] * 0.001; for (int i = imin; i <= imax; i++){ const int jmin = map.jinf[i]; const int jmax = map.jsup[i]; for (int j = jmin; j <= jmax; j++){ if (map.carte(i,j) && j>jmin_stock_area && j<jmax_stock_area){ double lat_corrected_area = area/ mat.lat_correction[j]; //Units of Total Stock = thous.mt Total_Stock += 1e-3*value(mat.dvarDensity(sp,a,i,j)) * W_mt * lat_corrected_area/nbt; } } } value(total_stock) = Total_Stock; } } |
| 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. |