Skip to content

Commit

Permalink
report zero for air mass when sun is down.
Browse files Browse the repository at this point in the history
  • Loading branch information
arondobos committed Oct 19, 2016
1 parent d63fc09 commit 973bd40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ class cm_pvsamv1 : public compute_module
p_solazi[idx] = (ssc_number_t)solazi;

// absolute relative airmass calculation as f(zenith angle, site elevation)
p_airmass[idx] = (ssc_number_t)(exp(-0.0001184 * hdr.elev) / (cos(solzen*3.1415926 / 180) + 0.5057*pow(96.080 - solzen, -1.634)));
p_airmass[idx] = sunup > 0 ? (ssc_number_t)(exp(-0.0001184 * hdr.elev) / (cos(solzen*3.1415926 / 180) + 0.5057*pow(96.080 - solzen, -1.634))) : 0.0f;
p_sunup[idx] = (ssc_number_t)sunup;

// save radiation values. the ts_accum_* variables are units of (W),
Expand Down

0 comments on commit 973bd40

Please sign in to comment.